Created
June 19, 2021 20:24
-
-
Save sabesansathananthan/3b7da8df2886728fd0b879ba07c20421 to your computer and use it in GitHub Desktop.
How React Components Are Reused
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
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