Skip to content

Commit

Permalink
use callback state signature
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Dec 16, 2024
1 parent d5dc329 commit 5ba0232
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/data/data-grid/master-detail/ControlMasterDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Alert from '@mui/material/Alert';

export default function ControlMasterDetail() {
const [detailPanelExpandedRowIds, setDetailPanelExpandedRowIds] = React.useState(
new Set(),
() => new Set(),
);

const handleDetailPanelExpandedRowIdsChange = React.useCallback((newIds) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/master-detail/ControlMasterDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Alert from '@mui/material/Alert';

export default function ControlMasterDetail() {
const [detailPanelExpandedRowIds, setDetailPanelExpandedRowIds] = React.useState(
new Set<GridRowId>(),
() => new Set<GridRowId>(),
);

const handleDetailPanelExpandedRowIdsChange = React.useCallback<
Expand Down

0 comments on commit 5ba0232

Please sign in to comment.