Skip to content

Instantly share code, notes, and snippets.

@moubi
Created July 3, 2020 06:59
Having form as part of more complex jsx
function Page() {
const { values, setValue } = useForm();
return (
<>
<Header />
<Navigation />
<SomeOtherThirdPartyComponent />
<form>
<input
value={values.name}
onChange={e => {
setValue("name", e.target.value);
}}
/>
<input
value={values.email}
onChange={e => {
setValue("email", e.target.value);
}}
/>
</form>
<Footer />
</>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment