S
S
Swaer2018-11-02 20:43:09
React
Swaer, 2018-11-02 20:43:09

How to properly render data from the store?

There is a property in the store, let it be obj, this is an object, there are a lot of objects in it, when you click on the button, a new object will be added to obj, and in the end you need all this to be rendered correctly, click on the button, and something on the screen there is a new one taken from store.obj

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vacoo, 2018-11-03
@Swaer

First you create a store and pass reducers to it. further in the root component you wrap the provider and pass it a store. Then, in the required component, map state and pass it to the component as a prop. and this component changes according to the store.
As an example:
https://codesandbox.io/embed/github/reactjs/redux/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question