Last active
December 26, 2017 09:48
-
-
Save srph/9b9a2430cc3d81772beb661ac62c08cf to your computer and use it in GitHub Desktop.
react computed props
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 MyComponent extends React.Component { | |
| render() { | |
| const {fullName} = this.props.computed | |
| } | |
| } | |
| export default computed({ | |
| fullName(state, props) { | |
| return `${props.user.firstName} ${props.user.lastName}` | |
| } | |
| })(MyComponent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment