Closed Luchanso closed 6 years ago
const onChangeState = state => {
router.go(state);
}
const mapStateToProps = (state) => {
isVK: state.router.path === 'vk'
sceneType: selector(state);
}
if (store.getState().router.path === 'vk') { console.log('vk') };
class GameComponent extends React.Component {
componentDidMount() {
// this.props.stateName === 'shop' - react
// this.props.stateName === 'boot' - game
if (sceneType === SCENES_TYPE.REACT) {
} else if (sceneType === SCENES_TYPE.GAME) {
gameInit(this.props.stateName);
// const game = new Game(...);
// game.state.add(...);
// game.state.start(this.props.router.stateName);
}
}
render() {
return (
<div id="game" />
);
}
}
<Switch>
<Router path=':platform/:stateName' component={GameComponent} />
</Switch>
Next: нарисовать наконец - то шоп
31