From cd1a16a08dbdd89dd12b48d8d8f8203826b15616 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Fri, 19 Jul 2024 01:01:53 +0200 Subject: [PATCH] [docs] Improve error message when moving between plans (#13874) --- .../src/DataGridPremium/DataGrid.tsx | 6 ++++-- packages/x-data-grid-pro/src/DataGridPro/DataGrid.tsx | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/x-data-grid-premium/src/DataGridPremium/DataGrid.tsx b/packages/x-data-grid-premium/src/DataGridPremium/DataGrid.tsx index d65e73b9fc43..148a352b3f34 100644 --- a/packages/x-data-grid-premium/src/DataGridPremium/DataGrid.tsx +++ b/packages/x-data-grid-premium/src/DataGridPremium/DataGrid.tsx @@ -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'), ); } @@ -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'), ); } diff --git a/packages/x-data-grid-pro/src/DataGridPro/DataGrid.tsx b/packages/x-data-grid-pro/src/DataGridPro/DataGrid.tsx index 0dca9c1f41c1..f14fd77dec17 100644 --- a/packages/x-data-grid-pro/src/DataGridPro/DataGrid.tsx +++ b/packages/x-data-grid-pro/src/DataGridPro/DataGrid.tsx @@ -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'), ); } @@ -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'), ); }