Created
March 5, 2019 13:18
-
-
Save sintell/4f5b64ed45925f1f8ac2603b06df8626 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { showedId, setShow } = this.props.context; | |
if ( | |
showedId === prevProps.context.showedId && | |
this.state.show === prevState.show && | |
this.props.show && | |
showedId !== this.state.id | |
) { | |
setShow(this.state.id); | |
} | |
if (showedId === null || this.state.id === null) { | |
return; | |
} | |
if (showedId !== prevProps.context.showedId) { | |
this.setState(({ id }) => ({ | |
show: showedId === id, | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment