@ui-schema/react
Version:
Schema-driven UI generator for React using JSON Schema. Build powerful form and interface generators with headless components and hooks.
18 lines • 467 B
JavaScript
import * as React from 'react';
import { jsx as _jsx } from "react/jsx-runtime";
const UIStoreActionsContextObj = React.createContext({});
export function UIStoreActionsProvider({
children,
onChange
}) {
const ctx = React.useMemo(() => ({
onChange
}), [onChange]);
return _jsx(UIStoreActionsContextObj.Provider, {
value: ctx,
children: children
});
}
export function useUIStoreActions() {
return React.useContext(UIStoreActionsContextObj);
}