Separation of concerns with React hooks

How to structure your React components

Hey there!

This week I have a short article on how to structure your React components.

Before the introduction of React hooks, the most used pattern for separating the business logic from the UI was dividing components into containers and presentational components (as explained by Dan Abramov here).

Custom React hooks offer a new approach to this, which I explain further in the article.

I find this way of creating components more intuitive, as custom hooks don’t have any JSX as opposed to the containers used in the previous pattern.

Continue reading

I’m curious what your approach is. Do you use React hooks the same way as I do? Feel free to hit reply and tell me about it!

Until next time and have a great week!