
Driving React Forward
The React Show
00:00
Is There a Better Way to Use Dependency Aray?
Anserin itself is unclear, and the situations vary so much. I don't know exactly what this better is yet, but i got imagined there's a better way to do it. And obviously one of the ways is, react has already said, m that dependency array in the future could be automatically filled in by compiler. But that also brings up another issue with it, which is the fact that people abuse tha dependency aray to basically due conditional use effects. You know, like, oh, i only want this effect to run when one variable changes, so i'm going to put that in the dependency aray list, which is not at all how it was intended to be used
Transcript
Play full episode