Skip to content

Instantly share code, notes, and snippets.

@komkanit
Last active January 21, 2018 17:31
Show Gist options
  • Save komkanit/244a52aa2a84bf6bc28976953d6035f0 to your computer and use it in GitHub Desktop.
Save komkanit/244a52aa2a84bf6bc28976953d6035f0 to your computer and use it in GitHub Desktop.
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