4 ms·
What i like to do is to write every component as a stateless component. This way you can write a wrapper component that handles local state, lifecycle methods e
by tmppdi9876 9y ago
What i like to do is to write every component as a stateless component. This way you can write a wrapper component that handles local state, lifecycle methods etc and just pass the needed functions and variables to the dumb component or you can switch to redux. The component doesn't care it just needs to have the state altering functions as parameters and the updated state. The problem i see is when new developers start writing a huge class that is coupled with the state handling and calling this all over the place.