123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import React from "react";
- import ConfirmBattle from "../components/ConfirmBattle";
- class ConfirmBattleContainer extends React.Component {
- constructor(props) {
- console.log("Constructor (getInitialState)");
- super(props);
- this.state = {
- isLoading: true,
- playerInfo: []
- };
- }
- componentWillMount() {
- console.log("componentWillMount");
- }
- componentDidMount() {
- console.log("componentDidMount");
- const query = this.props.location.query;
- // Fetch info from Github then update state.
- this.setState({
- isLoading: true
- });
- setTimeout(() => { this.setState({ isLoading: false }); }, 2000);
- }
- componentWillReceiveProps() {
- console.log("componentWillReceiveProps");
- }
- componentWillUnmount() {
- console.log("componentWillUnmount");
- }
- componentWillUpdate(nextProps, nextState) {
- console.log("componentWillUpdate: loading ?", nextState.isLoading);
- }
- render() {
- return (
- <ConfirmBattle
- isLoading={this.state.isLoading}
- playerInfo={this.state.playerInfo}
- />
- );
- }
- }
- ConfirmBattleContainer.contextTypes = {
- router: React.PropTypes.object.isRequired
- };
- export default ConfirmBattleContainer;
|