Created
April 25, 2019 21:31
-
-
Save andycarrell/8994f2a4e03d395602ce90575a6ce0d9 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
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