You are yielding null initially on the very first iteration. Therefore I guess this code won't work because of this test:
useGenerator = () => {
this.setState({ generatedObj: this.createVideoGenerator().next() }, () => {
if(!this.state.generatedObj.value){ // <--- this.state.generatedObj.value will be null instead of the first yielded video React element
this.props.handleChange("ENDED")
}
})
}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
for the issue with state being Async, you can also use a callback function to ensure you are setting it to the correct value.
You are yielding
null
initially on the very first iteration. Therefore I guess this code won't work because of this test: