import { connect } from "react-redux" ; import { Shogi } from "shogi.js" ; import { inputMove } from "../actions" ; import { BoardSet } from "../components/BoardSet" ; import { BoardSetState } from "../store" ; const mapStateToProps = ( state ) => { const currentNode = state . kifuTree . getCurrentNode ( ) ; const shogi = new Shogi ( ) ; shogi . initializeFromSFENString ( currentNode . sfen ) ; return { shogi , kifuTree : state . kifuTree , currentNode : currentNode , } ; } ; const mapDispatchToProps = { onInputMove : inputMove , } ; export const BoardSetContainer = connect ( mapStateToProps , mapDispatchToProps ) ( BoardSet ) ;