K
K
KnightForce2017-04-04 15:44:48
React
KnightForce, 2017-04-04 15:44:48

How does using Redux work with state?

For example, use Redux, but, for example, handle form input via setState , will there be a conflict?
After dispatch is re-rendered, how does it "collaborate" with state calls ?
For example there is:

<div>
   <h4><span>Часов: </span><span id="hours"><span></h4>
   <span>Минут: </span><span id="minuts"><span>
</div>

Suppose, through setState I display the date through state, Every hour through dipatch Hours.
How will updates work through react-redux ? Will the minutes be "demolished" (of course, they will be re-rendered, but how is the mechanism for checking such a bundle arranged)? Or does it take state into account ?
The example is absurd, but how does it all work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2017-04-04
@KnightForce

In your example, there is no main thing - how do you draw the minutes/hours? Through state or through props? Redux doesn't care if you use state or not, React Component doesn't care if you use redux or not.
You can update the state based on props received using Redux in componentWillReceiveProps

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question