Created
July 28, 2020 02:41
-
-
Save nfantone/422b1e13448bd417c6a47e6357594dd2 to your computer and use it in GitHub Desktop.
A simple class component holding a static reference
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
class MyExpensiveComponent extends React.Component { | |
myExpensiveField = null; | |
componentDidMount() { | |
this.myExpensiveField = createExpensiveField(this.props); | |
} | |
render() { | |
return <div>this.myExpensiveField.data</div> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment