The React Show cover image

React Component Lifecycle, What is a Component?

The React Show

00:00

Is There a Clean Up of the Component?

A lot of people, they're like, ok, inside my form, when this mounts, i'm going to fire off the network request to get this data. If you wait until your component is mounted, you're actually waiting longer than you need to. You should be able to use a dependency array referencing that value in your state change if it's ever changed. And what I find in a lot of react code is people try to tie everything to any time an effect needs to be used. They're like, oh,  I've just done something with this data. I now need this tis data or this ui or whatever, to be in the next state for whatever

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app