DEV Community

Discussion on: A Love Letter to Gen Z from Gen Y: Understanding React's Evolution

Collapse
 
p_syche_ profile image
Ola Linczewska

This was a great read!
I am in the "i learned class components" group too. I wonder what the younger developers think about these differences.
I especially see the value of your opinion about testing ("The step-by-step nature of class components encouraged testing practices, as we had to address each component's lifecycle events and behaviours individually.") Testing components with multiple useEffects is a totally different journey!

Collapse
 
anishamalde profile image
Anisha Malde

Thank-you Ola! Yea i'm really hoping to open up a conversation. Any recommendations for testing multiple useEffects? 😉

Collapse
 
p_syche_ profile image
Ola Linczewska

My first thought about recommendations in this case is: run away! XD
But if we're being honest I would start by trying to build a mental model of how the component works, maybe try to write down a flow diagram. Then try to figure out what exact behaviour you're testing :) Because, as papa Dodds always says: Don't test implementation details!
( kentcdodds.com/blog/testing-implem... )