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>
);
When using the recommended
refpattern it is not possible to use hooks outside of the form provider context.An acceptable solution may be to add support for a ref to
useFormStatusand others: