Skip to content

Support form ref as an option when using hooks #91

@10xjs

Description

@10xjs

When using the recommended ref pattern it is not possible to use hooks outside of the form provider context.

const form = React.useRef();

// this doesn't work!
const status = useFormStatus({form: form.current});

return (
  <Form ref={form}>
    ...
  </Form>
);

An acceptable solution may be to add support for a ref to useFormStatus and others:

const form = React.useRef();

// this would be a nice solution
const status = useFormStatus({form});

return (
  <Form ref={form}>
    ...
  </Form>
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions