O
O
Oleg Gamega2016-09-26 11:10:31
React
Oleg Gamega, 2016-09-26 11:10:31

What is the best way to separate code in a react redux application?

Hello.
How to better organize the code, I have smart components (containers) that do not know anything about how what is displayed and in fact serve to connect stupid components (components) with redux, everything is clear with this.
The question is where to make event handlers, for example, I have a SearchBar component, where to hang the handler on it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fetis26, 2016-09-26
@gadfi

Depends on the handler type. If this is some kind of internal logic, then in the component itself, of course. If this handler changes state, then it is created in the container and passed to the component as a property

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question