DEV Community

Discussion on: Moving away from ReactJs and VueJs on front-end using Clean Architecture

Collapse
 
ozzythegiant profile image
Oziel Perez

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

Collapse
 
xurxodev profile image
Jorge Sánchez Fernández

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