Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/public/static/error-codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"19": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150.",
"20": "MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.",
"21": "MUI: The `colorSchemes.%s` option is either missing or invalid.",
"22": "MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://next.mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature."
"22": "MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://next.mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.",
"23": "MUI: No TabContext provided. TabList must be used within a TabContext. Wrap your Tabs with <TabContext value={...}>. See https://mui.com/material-ui/react-tabs/#experimental-api for more info.",
"24": "MUI: No TabContext provided. TabPanel must be used within a TabContext. Wrap your TabPanel with <TabContext value={...}>. See https://mui.com/material-ui/react-tabs/#experimental-api for more info.",
"25": "MUI: The `colorSchemes.%s` option is either missing or invalid. Ensure the default color scheme is defined in colorSchemes with a valid palette configuration."
}
7 changes: 6 additions & 1 deletion packages/mui-lab/src/TabList/TabList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ const TabList = React.forwardRef(function TabList(
const { children: childrenProp, ...other } = props;
const context = useTabContext();
if (context === null) {
throw new TypeError('No TabContext provided');
throw /* minify-error */ new TypeError(
'MUI: No TabContext provided. ' +
'TabList must be used within a TabContext. ' +
'Wrap your Tabs with <TabContext value={...}>. ' +
'See https://mui.com/material-ui/react-tabs/#experimental-api for more info.',
);
}
const children = React.Children.map(childrenProp, (child) => {
if (!React.isValidElement<{ value?: string | number | undefined }>(child)) {
Expand Down
7 changes: 6 additions & 1 deletion packages/mui-lab/src/TabPanel/TabPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ const TabPanel = React.forwardRef(function TabPanel(

const context = useTabContext();
if (context === null) {
throw new TypeError('No TabContext provided');
throw /* minify-error */ new TypeError(
'MUI: No TabContext provided. ' +
'TabPanel must be used within a TabContext. ' +
'Wrap your TabPanel with <TabContext value={...}>. ' +
'See https://mui.com/material-ui/react-tabs/#experimental-api for more info.',
);
}
const id = getPanelId(context, value as string);
const tabId = getTabId(context, value as string);
Expand Down
3 changes: 2 additions & 1 deletion packages/mui-material/src/styles/createThemeWithVars.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ export default function createThemeWithVars(options = {}, ...args) {

if (!defaultScheme) {
throw /* minify-error */ new Error(
`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`,
`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid. ` +
'Ensure the default color scheme is defined in colorSchemes with a valid palette configuration.',
);
}

Expand Down
Loading