UNPKG

@schema-render/core-react

Version:

Through a set of simple JSON Schema, efficiently build a set of forms.

18 lines (17 loc) 661 B
/// <reference types="react" /> import type { IObjectAny } from '../typings/common'; import type { ICore } from '../typings/core'; import type { IChangeEvent } from '../typings/rootContext'; /** * 表单 value 受控与非受控模式支持 * 需要考虑【多渲染器内部 onChange 初始化值】场景,参考 952 调试文档 * @param props 内核参数 */ export default function useCoreValue(props: ICore): { value: IObjectAny; valueRef: import("react").MutableRefObject<IObjectAny>; onChange: (event: IChangeEvent) => void; getValue: () => IObjectAny; setValue: (nextValue: IObjectAny) => void; resetValue: () => void; };