UNPKG

@mui/x-date-pickers

Version:

The community edition of the Date and Time Picker components (MUI X).

15 lines (13 loc) 454 B
'use client'; import * as React from 'react'; export const PickerContext = /*#__PURE__*/React.createContext(null); /** * Returns the context passed by the Picker wrapping the current component. */ export const usePickerContext = () => { const value = React.useContext(PickerContext); if (value == null) { throw new Error('MUI X: The `usePickerContext` hook can only be called inside the context of a Picker component'); } return value; };