S
S
Stepan2015-12-26 01:14:18
JavaScript
Stepan, 2015-12-26 01:14:18

How to get data from Redux State?

Write data from database to state. State has changed
Get it in the component

function select(state, props) {
  let {
    filterState
    } = state;

  return {
    filterState
  };
}

export default connect(select)(FilterPage);

After that const { dispatch, filterState } = this.props;
Looked through the console data in place filterState._root.entries[0][0]
Everything is in place. How to manipulate them now to render the page?
Tried getState() not working

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2016-05-11
@maxfarseer

If you have data in props, then just render it in the render function (via this.props.filterState ).
Since your component is "attached" (using connect), you will always have up-to-date props.
Props have changed - render is called (according to the logic of react) => everything will be rendered with the actual data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question