Skip to main content
    export default class Game extends React.Component{
    constructor(){
        super()
        this.state={
            pause: null
        }
        
    }
    PauseShow(){
        this.setState={ pause: "block" }
        console.log("pauseshow")
    }
    PauseHide(){
        this.setState={ pause: "none" }
        console.log("pausehide")
    }
    render(){
        
        return(
            <div className="big-box">
                <Player idc="Game" src="assets/Fly_Me_to_the_Aegis_Seven_Moon.mp3"/>
                <GameOutput/>
                <GameData pauseMethod={this.PauseShow.bind(this)}/>
                <GameInput />
                <GamePause display={this.state.pause} pauseMethod={this.PauseHide.bind(this)}/>
                
            </div>
        )
    }
}

} Aquí Aquí llamo al un handler que pasé por props

    export default class GameData extends React.Component{
    constructor(){
        super()
    }
    render(){
        return(
            <div id="GameData">
                <button onClick={this.props.pauseMethod}>pause</button>
            </div>
            
        )
    }
}

}

He aquí el error completo, ocurre al presionar el boton y accionar el handler

backend.js:8730 Uncaught TypeError: inst.setState.bind is not a function at getData (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8730:49) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8576:57) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native)

backend.js:8730 Uncaught TypeError: inst.setState.bind is not a function at getData (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8730:49) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8576:57) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native)

export default class Game extends React.Component{
constructor(){
    super()
    this.state={
        pause: null
    }
    
}
PauseShow(){
    this.setState={ pause: "block" }
    console.log("pauseshow")
}
PauseHide(){
    this.setState={ pause: "none" }
    console.log("pausehide")
}
render(){
    
    return(
        <div className="big-box">
            <Player idc="Game" src="assets/Fly_Me_to_the_Aegis_Seven_Moon.mp3"/>
            <GameOutput/>
            <GameData pauseMethod={this.PauseShow.bind(this)}/>
            <GameInput />
            <GamePause display={this.state.pause} pauseMethod={this.PauseHide.bind(this)}/>
            
        </div>
    )
}

} Aquí llamo al un handler que pasé por props

export default class GameData extends React.Component{
constructor(){
    super()
}
render(){
    return(
        <div id="GameData">
            <button onClick={this.props.pauseMethod}>pause</button>
        </div>
        
    )
}

}

He aquí el error completo, ocurre al presionar el boton y accionar el handler

backend.js:8730 Uncaught TypeError: inst.setState.bind is not a function at getData (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8730:49) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8576:57) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native)

    export default class Game extends React.Component{
    constructor(){
        super()
        this.state={
            pause: null
        }
        
    }
    PauseShow(){
        this.setState={ pause: "block" }
        console.log("pauseshow")
    }
    PauseHide(){
        this.setState={ pause: "none" }
        console.log("pausehide")
    }
    render(){
        
        return(
            <div className="big-box">
                <Player idc="Game" src="assets/Fly_Me_to_the_Aegis_Seven_Moon.mp3"/>
                <GameOutput/>
                <GameData pauseMethod={this.PauseShow.bind(this)}/>
                <GameInput />
                <GamePause display={this.state.pause} pauseMethod={this.PauseHide.bind(this)}/>
                
            </div>
        )
    }
}

Aquí llamo al un handler que pasé por props

    export default class GameData extends React.Component{
    constructor(){
        super()
    }
    render(){
        return(
            <div id="GameData">
                <button onClick={this.props.pauseMethod}>pause</button>
            </div>
            
        )
    }
}

He aquí el error completo, ocurre al presionar el boton y accionar el handler

backend.js:8730 Uncaught TypeError: inst.setState.bind is not a function at getData (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8730:49) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8576:57) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native)

Origen Enlace

inst.setState.bind is not a function, problemas con State en react

estoy simplemente tratando de cambiar un state por medio de handlers en react pero al ejecutar las funciones el state no cambia.

aqui tengo las funciones, el state y los objetos por donde mando los props

cabe destacar que uso webpack con babel loader

export default class Game extends React.Component{
constructor(){
    super()
    this.state={
        pause: null
    }
    
}
PauseShow(){
    this.setState={ pause: "block" }
    console.log("pauseshow")
}
PauseHide(){
    this.setState={ pause: "none" }
    console.log("pausehide")
}
render(){
    
    return(
        <div className="big-box">
            <Player idc="Game" src="assets/Fly_Me_to_the_Aegis_Seven_Moon.mp3"/>
            <GameOutput/>
            <GameData pauseMethod={this.PauseShow.bind(this)}/>
            <GameInput />
            <GamePause display={this.state.pause} pauseMethod={this.PauseHide.bind(this)}/>
            
        </div>
    )
}

} Aquí llamo al un handler que pasé por props

export default class GameData extends React.Component{
constructor(){
    super()
}
render(){
    return(
        <div id="GameData">
            <button onClick={this.props.pauseMethod}>pause</button>
        </div>
        
    )
}

}

He aquí el error completo, ocurre al presionar el boton y accionar el handler

backend.js:8730 Uncaught TypeError: inst.setState.bind is not a function at getData (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8730:49) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8576:57) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native) at walkNode (chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8578:20) at chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js:8579:15 at Array.forEach (native)