Created
February 2, 2021 05:41
-
-
Save kurtisdunn/801d6cce5b82b099e37a00208fab56df to your computer and use it in GitHub Desktop.
React Component Cheat Sheet.
This file contains 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
static getDerivedStateFromProps(props, current_state) { | |
console.log(props) | |
if (current_state.data !== props.data) { | |
return [{ | |
id: props.id, | |
data: props.data | |
}] | |
} | |
return null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment