@mui/x-date-pickers
Version:
The community edition of the MUI X Date and Time Picker components.
13 lines (12 loc) • 714 B
JavaScript
'use client';
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
import * as React from 'react';
export const PickerTextFieldOwnerStateContext = /*#__PURE__*/React.createContext(null);
if (process.env.NODE_ENV !== "production") PickerTextFieldOwnerStateContext.displayName = "PickerTextFieldOwnerStateContext";
export const usePickerTextFieldOwnerState = () => {
const value = React.useContext(PickerTextFieldOwnerStateContext);
if (value == null) {
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X: The \`usePickerTextFieldOwnerState\` can only be called in components that are used inside a PickerTextField component` : _formatErrorMessage(146));
}
return value;
};