Refactor blocks away from useEffect where it makes sense #48225
Labels
[Feature] Blocks
Overall functionality of blocks
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Code Quality
Issues or PRs that relate to code quality
What problem does this address?
I just watched this video on the misuses of useEffect and it had some really interesting takes on why useEffect is used for a lot of things for which it shouldn't be used. Something that becomes extra clear since React 18 where it renders twice.
What is your proposed solution?
I'm not a React expert by any means, but I was looking through the core blocks and found a lot of places where useEffect is used for purposes that can be refactored quite easily, especially often when just updating the state. I would love to discuss this with some more advanced React devs here and see if there are any objections against refactoring these before I dive into the code and do the refactors, but I would love to help with this.
Any thoughts?
The text was updated successfully, but these errors were encountered: