Skip to content

Instantly share code, notes, and snippets.

@roman01la
Last active September 14, 2015 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roman01la/6f59312f447a2cfa9167 to your computer and use it in GitHub Desktop.
Save roman01la/6f59312f447a2cfa9167 to your computer and use it in GitHub Desktop.
function callWithEventValue(fn) {
return comp(fn, lenseTo('target', 'value'));
}
class SomeComponent extends React.Component {
render() {
return (
<div>
//...
<input type="text" onChange={ callWithValue(this.props.onChange) } />
// ...
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment