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!
I am a Developer Advocate @ Amazon where I am focused on engaging app and game developers around the world through teaching, code samples, and public speaking. Find me @ anisha.dev
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... )
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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!
Thank-you Ola! Yea i'm really hoping to open up a conversation. Any recommendations for testing multiple useEffects? 😉
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... )