DEV Community

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

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

You can decouple logic from react components without adding layers of abstraction other than the ones you'll get by default -usually- i.e. with HOCs (High Order Components) can be used for more things than just to increment New functionalities for other components. With HOCs you can actually separate responsibilities too.
You can create a HOC that accepts a React component as an argument, implements the data logic, and passes data, loading, and error as props into the wrapped React component.
This way your data and/or logic is decoupled from the UI.