@mui/utils
Version:
Utility functions for React components.
14 lines (13 loc) • 534 B
JavaScript
'use client';
import * as React from 'react';
export const RovingTabIndexContext = /*#__PURE__*/React.createContext(undefined);
if (process.env.NODE_ENV !== 'production') {
RovingTabIndexContext.displayName = 'RovingTabIndexContext';
}
export function useRovingTabIndexContext() {
const context = React.useContext(RovingTabIndexContext);
if (context === undefined) {
throw new Error('MUI: RovingTabIndexContext is missing. Roving tab index items must be placed within a roving tab index provider.');
}
return context;
}