Skip to content

Commit

Permalink
[docs] Improve error message when moving between plans
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jul 17, 2024
1 parent 211714d commit a79d673
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions packages/x-data-grid-premium/src/DataGridPremium/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ export function DataGrid() {

throw new Error(
[
"You try to import `DataGrid` from @mui/x-data-grid-premium but this module doesn't exist.",
"You try to import `DataGrid` from @mui/x-data-grid-premium but this module isn't exported from this npm package.",
'',
"Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.",
'',
].join('\n'),
);
}
Expand All @@ -25,9 +26,10 @@ export function DataGridPro() {

throw new Error(
[
"You try to import `DataGridPro` from @mui/x-data-grid-premium but this module doesn't exist.",
"You try to import `DataGridPro` from @mui/x-data-grid-premium but this module isn't exported from this npm package.",
'',
"Instead, you can do `import { DataGridPremium } from '@mui/x-data-grid-premium'`.",
'',
].join('\n'),
);
}
11 changes: 8 additions & 3 deletions packages/x-data-grid-pro/src/DataGridPro/DataGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ export function DataGrid() {

throw new Error(
[
"You try to import `DataGrid` from @mui/x-data-grid-pro but this module doesn't exist.",
"You try to import `DataGrid` from @mui/x-data-grid-pro but this module isn't exported from this npm package.",
'',
"Instead, you can do `import { DataGridPro } from '@mui/x-data-grid-pro'`.",
'',
].join('\n'),
);
}
Expand All @@ -25,9 +26,13 @@ export function DataGridPremium() {

throw new Error(
[
"You try to import `DataGridPremium` from @mui/x-data-grid-pro but this module doesn't exist.",
"You try to import `DataGridPremium` from @mui/x-data-grid-pro but this module isn't exported from this npm package.",
'',
'Instead, if you have a Premium plan license or want to try Premium, you can do this:',
`import { DataGridPremium } from '@mui/x-data-grid-premium'`,
'',
"Otherwise, you can stay on the Pro plan: `import { DataGridPro } from '@mui/x-data-grid-pro'`.",
'',
"Instead, you can do `import { DataGridPro } from '@mui/x-data-grid-pro'`.",
].join('\n'),
);
}

0 comments on commit a79d673

Please sign in to comment.