react-hook-form-context
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i react-hook-form-context

Weekly Downloads

61

Version

1.0.0

License

MIT

Unpacked Size

11 kB

Total Files

13

Last publish

Collaborators

  • hosseinmdeveloper