Skip to content

Instantly share code, notes, and snippets.

@rohanBagchi
Last active March 21, 2019 06:33
Show Gist options
  • Save rohanBagchi/f755ec21ba329cf5cce9d6d11b0863cf to your computer and use it in GitHub Desktop.
Save rohanBagchi/f755ec21ba329cf5cce9d6d11b0863cf to your computer and use it in GitHub Desktop.
For Medium
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