Correct me if I'm wrong but one particular downside I'm noticing from this is that if you write your components to use a state from a store or from some type of provider, now the component is coupled to that feature. Almost all your components should be written in such a way that they don't depend on anything. Only a top level component such as a page or template should handle fetching/changing state or retrieval of API data, but at the same time, ensure that you don't have too deep of a component tree that you need to pass state several levels down
I think creating an agnostic of the app state component only has sense if this one is used in several contexts.
For example for a library of components as a table with advanced functionalities that will be used in several apps or a dropdown used in multiple places in your app.
But components (pages or not pages) used in a unique context I think that is not a problem.
Regards
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.
Correct me if I'm wrong but one particular downside I'm noticing from this is that if you write your components to use a state from a store or from some type of provider, now the component is coupled to that feature. Almost all your components should be written in such a way that they don't depend on anything. Only a top level component such as a page or template should handle fetching/changing state or retrieval of API data, but at the same time, ensure that you don't have too deep of a component tree that you need to pass state several levels down
Hi, thanks for your comment.
I think creating an agnostic of the app state component only has sense if this one is used in several contexts.
For example for a library of components as a table with advanced functionalities that will be used in several apps or a dropdown used in multiple places in your app.
But components (pages or not pages) used in a unique context I think that is not a problem.
Regards