Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have been learning react for quite some time and I just recently came across the term React.memo() that helps us to optimize our functional components thus increase our application's performance. I understood what's it for but one thing I don't understand is that when to use it? does it make sense to use it in our every primary child components besides App.js? #22623

Closed
surajsgh opened this issue Oct 25, 2021 · 3 comments
Labels
React 18 Bug reports, questions, and general feedback about React 18 Type: Discussion

Comments

@surajsgh
Copy link

No description provided.

@surajsgh surajsgh added React 18 Bug reports, questions, and general feedback about React 18 Type: Discussion labels Oct 25, 2021
@umarmuhandis
Copy link

Even though memo is thought to help us optimize our application's code, it comes with a cost. Most of the time you don't have to scratch your head in terms of performance since React is very fast. It's even better to be cautious when you are dealing with performance, because hooks such as useMemo, useCallback have their tradeoffs. If you understand the tradeoffs well, then feel free to use them :)

@RinatValiullov
Copy link

@Royalchampion

Hopefully this disussion will help you understand when to use and when not to use React.memo. Mark Erikson gave a good answer in one of the comments.

@surajsgh
Copy link
Author

Yeah, I went through it. Thank You so much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
React 18 Bug reports, questions, and general feedback about React 18 Type: Discussion
Projects
None yet
Development

No branches or pull requests

3 participants