"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useGenericContext = useGenericContext;
exports.FormConsumer = exports.FormProvider = exports.FormContext = void 0;

var _react = require("react");

/**
 * Utility for casting the un-typed context to the generic with type parameter,
 * so that form consumers can have type-constrained data, dataDriller, and updateData
 * @param context
 */
function useGenericContext(context) {
  var processedContext = (0, _react.useContext)(context);
  return processedContext;
}

var FormContext = /*#__PURE__*/(0, _react.createContext)({
  data: undefined,
  dataDriller: undefined,
  updateData: function updateData(_) {}
});
exports.FormContext = FormContext;
var FormProvider = FormContext.Provider,
    FormConsumer = FormContext.Consumer;
exports.FormConsumer = FormConsumer;
exports.FormProvider = FormProvider;