Skip to content

Instantly share code, notes, and snippets.

@amanshu-kataria
Created May 14, 2018 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amanshu-kataria/2c7decfddeff2686eebf74e2c6d11012 to your computer and use it in GitHub Desktop.
Save amanshu-kataria/2c7decfddeff2686eebf74e2c6d11012 to your computer and use it in GitHub Desktop.
componentWillReceiveProps(nextProps){
if(nextProps.someValue!==this.props.someValue){
//Perform some operation
this.setState({someState: someValue });
this.classMethod();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment