UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

14 lines 576 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useFormValues = void 0; const react_hook_form_1 = require("react-hook-form"); // hook taken from https://react-hook-form.com/docs/usewatch/#rules const useFormValues = () => { const { getValues } = (0, react_hook_form_1.useFormContext)(); return { ...(0, react_hook_form_1.useWatch)(), // subscribe to form value updates ...getValues(), // always merge with latest form values }; }; exports.useFormValues = useFormValues; //# sourceMappingURL=useFormValues.js.map