Re:Things I wish I knew about state management when I starte...
by ellius on Monday February 10, 2020 @04:53PM
(#22293803)
Sure, but what do you count as a "component"? It varies by language, framework, platform, and pattern.
Re:Things I wish I knew about state management when I starte...
by nohuhu on Monday February 10, 2020 @04:54PM
(#22293809)
How do you test individual components in isolation if they depend on the global state store?
Re:Things I wish I knew about state management when I starte...
by root_axis on Monday February 10, 2020 @06:44PM
(#22294631)
That's a code smell. 99% of components in a project should rely on props.
Re:Things I wish I knew about state management when I starte...
by nohuhu on Monday February 10, 2020 @08:22PM
(#22295153)
How does that play with Redux Hooks for example? https://react-redux.js.org/next/api/hooks
If you are using hooks in your components, you need the global store instance. To call this unit testing is too big a stretch for me.
Unit tests are for testing individual components of your application (web or otherwise)
e2e or integration tests are for testing your application component/lib/api/whatever boundaries