Skip to content

Instantly share code, notes, and snippets.

@andycarrell
Created April 25, 2019 21:31
Show Gist options
  • Save andycarrell/8994f2a4e03d395602ce90575a6ce0d9 to your computer and use it in GitHub Desktop.
Save andycarrell/8994f2a4e03d395602ce90575a6ce0d9 to your computer and use it in GitHub Desktop.
const useInputValue = initialValue => {
const [value, setX] = React.useState(initialValue);
const prop = p => o => o[p];
const setValue = Ramda.compose(
setX,
prop("value"),
prop("target"),
);
return [value, setValue];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment