react-hook-form-context
v1.0.0
Published
React Hook Form Context
Downloads
3,147
Maintainers
Readme
React-hook-form-context
Create Context
const FormContext = createFormContext({
param: "",
});
function App() {
return (
<FormContext.Provider mode="submit" revalidateMode="onChange">
...rest
</FormContext.Provider>
);
}
//In your Component
const { param } = FormContext.useWatch();
<FormContext.Controller
name="param"
render={({field})=><input {...field}>}
/>