A
A
Artyom2020-05-21 17:49:42
React
Artyom, 2020-05-21 17:49:42

Should state be completely migrated to Redux, and if not, when should you use local?

When do you need to use store redux-a, and when do you need to use react's local state? Passing one of the paid courses, I saw how the author partially uses the local state, but for the most part transfers everything to Redux. I didn’t quite understand in what cases it is more profitable to use the state react. I will be glad if you enlighten

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yustas Alexu, 2020-05-21
@danyvasnafig

The strategy is to give preference to the local state. I can say from my own experience that in most cases the global state is not needed. A typical case when a global state is used is authorization.

E
Egor Zhivagin, 2020-05-21
@Krasnodar_etc

The data that is needed in several components is transferred to the editor.
In local states, usually only some flags remain that affect the display of the component itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question