Last active
March 21, 2019 06:33
-
-
Save rohanBagchi/f755ec21ba329cf5cce9d6d11b0863cf to your computer and use it in GitHub Desktop.
For Medium
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 getNameFieldValue = (data: any) => data.foo; | |
const shouldReinitialize = () => !props.shouldReinitialize; | |
<InnerField | |
fieldData={innerFieldData} | |
getFieldValue={getNameFieldValue} | |
shouldReinitialize={shouldReinitialize} | |
> | |
{({ handleChange: innerHandleChange, value }: any) => { | |
return ( | |
<InputWrapper> | |
<input | |
placeholder='Foo Fighters!' | |
name="foo-name" | |
value={value} | |
onBlur={handleBlur} | |
onChange={innerHandleChange} | |
maxLength={maxLength} | |
/> | |
<InputCount inputValue={value} maxLength={maxLength} /> | |
</InputWrapper> | |
); | |
}} | |
</InnerField> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment