M
M
Maria_Gavrilova2020-05-02 18:25:00
React
Maria_Gavrilova, 2020-05-02 18:25:00

File structure in React + Redux?

Is it relevant in 2020 to separate components into components (presentation stupid) and containers (stateful)? Dan Abramov (here - https://medium.com/@dan_abramov/smart-and-dumb-com... says that this is irrelevant now, since Hooks allow you to achieve the same without separation into components & containers. What he is talking about How do hooks allow you to do this Do you divide your components into dumb and smart ones?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yustas Alexu, 2020-05-02
@Maria_Gavrilova

What is he talking about? How do hooks allow you to do this?

I believe Dan is referring to custom hooks that can be put into separate files along with the logic, leaving only simple logic in the component.
Do you divide your components into stupid and smart ones?

Yes, even using hooks, out of habit, I call the wrapper over the child component a container and try to leave the entire state and manipulations with it in the container, passing only callbacks to the child components.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question