2 ms·
I'm not sure if I'm following, are you saying that class-based components (whether React or not) could be characterized as "an object instance with random metho
by jrochkind1 4y ago
I'm not sure if I'm following, are you saying that class-based components (whether React or not) could be characterized as "an object instance with random method calls that manipulate the DOM", and thus React functional components offer an advantage to them?
- edgyquant 4y agoIirc correctly the hooks in functional react are classes under the hood (maybe I’m wrong and it’s functions, been awhile.) The advantage functional react has over class based is reusability. You could reuse classes before and functions within them but it gets harry keeping a clean architecture. With functional components you can write hooks that allow you to reuse all state logic between components.