Podchaser Logo
Home
Fixating on fixing rerenders

Fixating on fixing rerenders

Released Saturday, 29th May 2021
Good episode? Give it some love!
Fixating on fixing rerenders

Fixating on fixing rerenders

Fixating on fixing rerenders

Fixating on fixing rerenders

Saturday, 29th May 2021
Good episode? Give it some love!
Rate Episode

https://kentcdodds.com/blog/fix-the-slow-render-before-you-fix-the-re-renderhttps://kentcdodds.com/blog/colocationhttps://epicreact.dev/improve-the-performance-of-your-react-formsHello there friends. So today somebody shared a lightbri with me and Iassumed that it was just a library to help you track rerenders. But itturns out it's like a state management library and that helps you avoidrerenders but my initial reaction and thought about tracking re-renders isthe tools like that.I think lead people to jump directly to the natural and obvious solution,which is often not the best solution and I'm talking about memoization. Sowhen,If you're tracking rerenders and that's how you measure whethersomething's faster or not you're gonna say, oh well this component didn'tneed to rerender so therefore.I will apply the re-render hammer to solve this problem and that is reactmemo. And then you have to use memo or use callback all the things that youpass to it. And that spiders in into the rest of your code base reallyeasily. And so what I recommend is I have a blog post called fix the slowrender before you fix the rerender and so you have to put a little bit morethought into it, but you find out what part of you.Here rendering is slow because even if you fix the rerender at some pointyou've got to render like there are necessary renders. And if those areslow then that's not a great user experience either. And so if you can fixthat then maybe you'll be able to avoid needing to worry about rerenders.But sometimes you just there's nothing that's slow in particular. It's justa lot of things that add up to make the experience slower and so fixingrenders is kind of the the best approach for that. And when you're in thatsituation, then I actually wrote.Another blog post called state lookcolocation can make your react apps faster and just recently wrote a blogpost that takes an angle on the like forms and how you can use statecollocation with forms and I'll link all of those at the top of this thedescription this episode.But basically, I think that we can get a lot by using state co-locationalso composability and composing our components, especially like layoutcomponents, so you don't have to pass.Props through all these other youknow app components And as with a combination of the way that you structurethings you often don't have to worry about unnecessary renders because theyjust can't happen.So anyway, the library itself was a state management tool and and somepeople get a kick out of that and that's great. That's awesome. I haven'tfound myself needing to reach for many state management tools outside ofreact query and went with Remix. I don't really need a state managementtool.It's pretty awesome. But yeah, those are just some of the thoughts that Ihad when I first saw the name of this librarian. So hope that,Isinteresting and helpful have a nice day.

Show More
Rate

Join Podchaser to...

  • Rate podcasts and episodes
  • Follow podcasts and creators
  • Create podcast and episode lists
  • & much more

Episode Tags

Do you host or manage this podcast?
Claim and edit this page to your liking.
,

Unlock more with Podchaser Pro

  • Audience Insights
  • Contact Information
  • Demographics
  • Charts
  • Sponsor History
  • and More!
Pro Features