ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
10 lines • 395 B
JavaScript
import { useFormContext, useWatch } from 'react-hook-form';
// hook taken from https://react-hook-form.com/docs/usewatch/#rules
export const useFormValues = () => {
const { getValues } = useFormContext();
return {
...useWatch(), // subscribe to form value updates
...getValues(), // always merge with latest form values
};
};
//# sourceMappingURL=useFormValues.js.map