Answers for "setstate to false after 10 sec react native"

0

setstate to false after 10 sec react native

saveAndContinue: function(e) {
    e.preventDefault()

    if(this.state.submitted==false) {
        email = this.refs.email.getDOMNode().value
        this.setState({email: email})
        this.setState({submitted: !this.state.submitted});
        setTimeout(function(){
             this.setState({submitted:false});
        }.bind(this),10000);  // wait 5 seconds, then reset to false
   }
}
Posted by: Guest on June-02-2021

Code answers related to "setstate to false after 10 sec react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language