import React, { Component } from 'react'; import { kanaDictionary } from '../../data/kanaDictionary'; import ShowStage from './ShowStage'; import Question from './Question'; class Game extends Component { state = { showScreen: '' } componentWillMount() { this.setState({showScreen: 'stage'}); } stageUp = () => { this.props.stageUp(); this.setState({showScreen: 'stage'}); } lockStage = stage => { this.setState({showScreen: 'question'}); this.props.lockStage(stage); } showQuestion = () => { this.setState({showScreen: 'question'}) } render() { return (
{ this.state.showScreen==='stage' && } { this.state.showScreen==='question' && }
); } } export default Game;