---
title: "Comment by Jayesh Potlabattini on \"A Beginner guide to Mastering Re-rendering in React\" | Hashnode"
description: "Understanding re-renders is always a bit difficult but this article made it really really easy! Thanks a lot Atharva, I learned something new today."
url: "https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63deb2a5870f1899b96ee8af"
---

[Discussion](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d)

Comment [A Beginner guide to Mastering Re-rendering in React](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d)

[Jayesh Potlabattini](https://hashnode.com/@JayeshVP24)

[Feb 4, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63deb2a5870f1899b96ee8af)

Understanding re-renders is always a bit difficult but this article made it really really easy! Thanks a lot Atharva, I learned something new today.

[Jayesh Potlabattini](https://hashnode.com/@JayeshVP24)

[Feb 4, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63deb2a5870f1899b96ee8af#reply-63deb89922ecad9870b5e7a1)

also could you explain a bit more on what can we consider as expensive operation? In your example with useContext you have used setState as an expensive operation. Is that just for example or actual? How do we differentiate between expensive and non-expensive operations?

[Jayesh Potlabattini](https://hashnode.com/@JayeshVP24)

[Feb 5, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63deb2a5870f1899b96ee8af#reply-63dfaa65666a6ca61942d1de)

[Atharva Bhuse](https://hashnode.com/@atharvabhuse) thanks for answering my questions Atharva👍

[Atharva Bhuse](https://hashnode.com/@atharvabhuse)

[Feb 5, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63deb2a5870f1899b96ee8af#reply-63dfaa73bf2ce4a649f5d602)

Thanks Jayesh

[Atharva Bhuse](https://hashnode.com/@atharvabhuse)

[Feb 5, 2023](https://hashnode.com/posts/a-beginner-guide-to-mastering-re-rendering-in-react/63d91ede69f9992b3f24590d/comment/63deb2a5870f1899b96ee8af#reply-63dfab7ebf2ce4a649f5d624)

Hello Jayesh, I would be happy to help you with that. Expensive operations are those operations that take longer time to execute such as complicated functions in component, API all with larger amount of data. setState can be an expensive function and we can avoid it by simply batching multiple states with single setState. we can also use useMemo() hook to decrease number of re-renders. Thanks Jayesh for your question, have a great day!!
