Skip to content

Instantly share code, notes, and snippets.

@sabesansathananthan
Last active June 19, 2021 20:25
Show Gist options
  • Save sabesansathananthan/97a7cea7df6945b8e41583e6cb829a14 to your computer and use it in GitHub Desktop.
Save sabesansathananthan/97a7cea7df6945b8e41583e6cb829a14 to your computer and use it in GitHub Desktop.
How React Components Are Reused
render() {
// Each call to the render function creates a new EnhancedComponent
// EnhancedComponent1 !== EnhancedComponent2
const EnhancedComponent = enhance(MyComponent);
// This will cause the subtree to be unloaded and remounted every time it is rendered!
return <EnhancedComponent />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment