From 77d868818def17b5da5299040f2c33a06f0ef754 Mon Sep 17 00:00:00 2001 From: Aman Mahajan Date: Mon, 16 Dec 2024 16:34:21 -0600 Subject: [PATCH] Improve error message --- src/hooks/useRowSelection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useRowSelection.ts b/src/hooks/useRowSelection.ts index c0b60855bd..6f67747854 100644 --- a/src/hooks/useRowSelection.ts +++ b/src/hooks/useRowSelection.ts @@ -23,7 +23,7 @@ export function useRowSelection() { const rowSelectionChangeContext = useContext(RowSelectionChangeContext); if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) { - throw new Error('useRowSelection must be used within DataGrid cells'); + throw new Error('useRowSelection must be used within renderCell'); } return { @@ -55,7 +55,7 @@ export function useHeaderRowSelection() { const headerRowSelectionChangeContext = useContext(HeaderRowSelectionChangeContext); if (headerRowSelectionContext === undefined || headerRowSelectionChangeContext === undefined) { - throw new Error('useHeaderRowSelection must be used within DataGrid cells'); + throw new Error('useHeaderRowSelection must be used within renderHeaderCell'); } return {