import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
const useFieldProps = (schema)=>{
    const options = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.SchemaOptionsContext);
    const scope = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.SchemaExpressionScopeContext);
    const scopeRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
    scopeRef.current = scope;
    return schema.toFieldProps({
        ...options,
        get scope () {
            return {
                ...options.scope,
                ...scopeRef.current
            };
        }
    });
};
export { useFieldProps };
