@mui/x-date-pickers
Version:
The community edition of the MUI X Date and Time Picker components.
16 lines (15 loc) • 738 B
JavaScript
'use client';
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
import * as React from 'react';
import { PickerActionsContext } from "../internals/components/PickerProvider.mjs";
/**
* Returns a subset of the context passed by the Picker wrapping the current component.
* It only contains the actions and never causes a re-render of the component using it.
*/
export const usePickerActionsContext = () => {
const value = React.useContext(PickerActionsContext);
if (value == null) {
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X: The \`usePickerActionsContext\` can only be called in fields that are used as a slot of a Picker component` : _formatErrorMessage(148));
}
return value;
};