Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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
   }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: hidden vue js 
Javascript :: mongodb match array not empty aggregation 
Javascript :: vue directive parameter 
Javascript :: javscript explode by backticks 
Javascript :: ${product} meaning in react js 
Javascript :: 4.7.1. The String Operator +¶ 
Javascript :: open menu 
Javascript :: grotesque meaning 
Javascript :: angualr js busy when routing 
Javascript :: add expressions 
Javascript :: how to turn off auto refresh a href in javascript 
Javascript :: corousal in react 
Javascript :: 9.4.1.2. Loop Condition¶ 
Javascript :: Shorthand for calling functions conditionally 
Javascript :: how to push object in array in angular from an api 
Javascript :: how to see the defenition of a function inside browser console 
Javascript :: array destructuring mdn 
Javascript :: how to convert serilazed data to json in js 
Javascript :: Using Scrip as Web app 
Javascript :: get raw sql query from codeigniter query builder 
Javascript :: why browser is not detecting my current position 
Javascript :: This will give Iodoform reaction on the treatment with Na2CO3 and I2: 
Javascript :: divide string in lines react native max width 
Javascript :: bootstrap off canvas not working 
Javascript :: point towards mouse wick editor 
Javascript :: col flex antd 
Javascript :: nextjs scheduler 
Javascript :: javascript empty object check ES5 
Javascript :: factorial recursion javascript 
Javascript :: × react TypeError: Object(...) is not a function 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =