Closed acollazomayer closed 1 year ago
You should be able to use react-hook-form
's useFormContext()
already:
import {useFormContext} from 'react-hook-form';
function FormContainer({children, onSubmit}:{children: ReactNode, onSubmit: ()=>void}) {
const form = useFormContext();
}
This brings up a good point though - this could be documented better.
Just updated the documentation to make this more obvious, I think useFormContext
already as easy as possible to use as is, so won't pass the prop to the form container or anything.
Let me know if that doesn't solve your problem, though.
gonna close, if the above solution didn't work let me know
@iway1 its not working properly, FE when you use an async function the isSubmitting value from the state never changes back to false
@iway1 Did you check this, can you please show examples on how to handle async submissions. Because I am not able to make this work.
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.