Answer the question
In order to leave comments, you need to log in
What is the best way to filter data from the Redux Store in a component?
import React from 'react';
import { connect } from 'react-redux';
import Post from './Post';
const SavedPosts = props => {
return <div>
{ props.map(post => <Post {...post}>) }
</div>
}
const mapStateToProps = ({postReducer}, props) => {
return {
posts: postReducer.posts
}
};
export default connect(mapStateToProps)(SavedPosts);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question