Created
October 12, 2020 18:23
-
-
Save YounglanHong/cb7946c407875885fe44569f4f148487 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Card from "../components/Card"; | |
import { connect } from "react-redux"; | |
// 컴포넌트에서 필요한 데이터를 store에서 추출하여 객체 반환 | |
function mapStateToProps(state) { | |
return { | |
cards: state.card.cards, | |
decks: state.deck.decks, | |
category: state.deck.category, | |
}; | |
} | |
// connect로 연결된 컴포넌트에 store의 데이터를 props로 전달 | |
export default connect(mapStateToProps)(Card); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment