i have to say, that i searching for answer in hours and nothing helped me, so here my problem:
componentDidMount() {
var self = this
console.log(`INIT keys ${this.props.variants}`); // INIT KEYS [Object], [Object] ...
this.interval = setInterval(function() {
console.log(`Keys ${self.props.variants}`); // Keys ...
}.bind(self), 1000)
}
Init keys exists, but keys inside interval not.
Can someone help me? :)
selfdefined ? Shouldn't you usethisinside of your function instead ofself?thisinside the callback (but usesself), so an arrow function wouldn't help here.Keys ${this.props.variants}); instead