Skip to content

Commit 38c6284

Browse files
authored
Better error message (#3672)
Improve error message
1 parent 011e1f9 commit 38c6284

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hooks/useRowSelection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function useRowSelection() {
2323
const rowSelectionChangeContext = useContext(RowSelectionChangeContext);
2424

2525
if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) {
26-
throw new Error('useRowSelection must be used within DataGrid cells');
26+
throw new Error('useRowSelection must be used within renderCell');
2727
}
2828

2929
return {
@@ -55,7 +55,7 @@ export function useHeaderRowSelection() {
5555
const headerRowSelectionChangeContext = useContext(HeaderRowSelectionChangeContext);
5656

5757
if (headerRowSelectionContext === undefined || headerRowSelectionChangeContext === undefined) {
58-
throw new Error('useHeaderRowSelection must be used within DataGrid cells');
58+
throw new Error('useHeaderRowSelection must be used within renderHeaderCell');
5959
}
6060

6161
return {

0 commit comments

Comments
 (0)