I\'m trying to load a splash screen for an iOS app built in React Native. I\'m trying to accomplish this through class states and then a setTimeout function as follows:
You can bind this to your function by adding .bind(this) directly to the end of your function definition. You would rewrite your code block as:
this
.bind(this)
setTimeout(function () { this.setState({ timePassed: true }); }.bind(this), 1000);