Last active
January 21, 2018 17:31
-
-
Save komkanit/244a52aa2a84bf6bc28976953d6035f0 to your computer and use it in GitHub Desktop.
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
import { compose, withProps } from recompose | |
class RefsStore { | |
store(name, value) { | |
this[name] = value; | |
} | |
} | |
const enhance = compose( | |
withProps({ refs: new RefsStore() }), | |
) | |
const Component = (props) => ( | |
<div | |
ref={ref => props.refs.store('foo', ref)} | |
> | |
test | |
</div> | |
); | |
export default enhance(Component); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment