Answer the question
In order to leave comments, you need to log in
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);
const { dispatch, filterState } = this.props;
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question