formio-pr-react
Version:
React renderer for form.io forms.
13 lines (12 loc) • 465 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.useFormioContext = useFormioContext;
const react_1 = require("react");
const FormioContext_1 = require("../contexts/FormioContext");
function useFormioContext() {
const context = (0, react_1.useContext)(FormioContext_1.FormioContext);
if (!context) {
throw new Error('useFormioContext must be used within a FormioProvider component.');
}
return context;
}