Created
May 20, 2017 00:58
-
-
Save zhaoyao91/d3ea72bb0b5e6c0b4fd046a2354dbe00 to your computer and use it in GitHub Desktop.
HOC to define a component which requires display name, prop types and being pure
This file contains 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
import { setDisplayName, setPropTypes, pure, compose } from 'recompose' | |
export default function (displayName, propTypes = {}) { | |
return compose( | |
setDisplayName(displayName), | |
setPropTypes(propTypes), | |
pure | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment