From 130b949455ae20abe0098688065e0e8fb76eaed6 Mon Sep 17 00:00:00 2001 From: Kenan Yusuf Date: Tue, 29 Oct 2024 10:45:12 +0000 Subject: [PATCH] Improve warning message --- .../src/hooks/features/listView/useGridListView.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/x-data-grid/src/hooks/features/listView/useGridListView.tsx b/packages/x-data-grid/src/hooks/features/listView/useGridListView.tsx index dc3b6a5c1571..246892724148 100644 --- a/packages/x-data-grid/src/hooks/features/listView/useGridListView.tsx +++ b/packages/x-data-grid/src/hooks/features/listView/useGridListView.tsx @@ -74,9 +74,11 @@ export function useGridListView( React.useEffect(() => { if (props.unstable_listView && !props.unstable_listColumn) { - warnOnce( + warnOnce([ 'MUI X: The `unstable_listColumn` prop must be set if `unstable_listView` is enabled.', - ); + 'To fix, pass a column definition to the `unstable_listColumn` prop, e.g. `{ field: "example", renderCell: (params) =>
{params.row.id}
}`.', + 'For more details, see https://mui.com/x/react-data-grid/list-view/', + ]); } }, [props.unstable_listView, props.unstable_listColumn]); }