1.0.0 • Published 1 year ago

react-hook-form-context v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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}>}
/>