react-final-form-hooks
react-final-form-hooks copied to clipboard
support `decorators`
Are you submitting a bug report or a feature request?
feature request
What is the expected behavior?
just like react-final-form.
You can by doing this:
const { form } = useForm({ onSubmit });
calculator(form);
Or, regarding https://github.com/final-form/react-final-form/blob/v5.1.0/src/ReactFinalForm.js#L94, maybe more something like that:
useEffect(() => {
const unsubscribe = calculator(form);
return () => unsubscribe();
});
and perhaps we can use this useEffect only on mount
useEffect(() => {
const unsubscribe = calculator(form);
return () => unsubscribe();
}, []);
or maybe form
useEffect(() => {
const unsubscribe = calculator(form);
return () => unsubscribe();
}, [form]);