Skip to content

Commit

Permalink
[core] Small fixes on docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Dec 29, 2024
1 parent 2fa4d4f commit dac7c3d
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Following are all team members who have contributed to this release:

#### Breaking changes

- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`.
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:

- For `.root` element, use `slotProps.root`.
- For `.main` element (the one with `role="grid"`), use `slotProps.main`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The `<PieChart />` by error had the code to render axes.
This code has been removed in v8, which implies removing the following props: `axisHighlight`, `topAxis`, `rightAxis`, `bottomAxis`, and `leftAxis`.

This should not impact your code.
If you used axes in a pie chart please open an issue, we would be curious to get more information about the use-case.
If you used axes in a pie chart please open an issue, we would be curious to get more information about the use case.

## Remove `resolveSizeBeforeRender` prop

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Below are described the steps you need to make to migrate from v7 to v8.

### Props

- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`.
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:
- For the `.root` element, use `slotProps.root`
- For the `.main` element (the one with `role="grid"`), use `slotProps.main`

Expand All @@ -57,7 +57,7 @@ Below are described the steps you need to make to migrate from v7 to v8.

```diff
-const idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
-const rowId = idToIdLookup[id]
-const rowId = idToIdLookup[id];
+const rowsLookup = gridRowsLookupSelector(apiRef);
+const rowId = apiRef.current.getRowId(rowsLookup[id]);
```
Expand Down Expand Up @@ -91,13 +91,13 @@ Below are described the steps you need to make to migrate from v7 to v8.
- The `useGridSelector` signature has been updated due to the introduction of arguments parameter in the selectors. Pass `undefined` as `arguments` if the selector doesn't use any arguments.

```diff
-const output = useGridSelector(apiRef, selector, equals)
+const output = useGridSelector(apiRef, selector, arguments, equals)
-const output = useGridSelector(apiRef, selector, equals);
+const output = useGridSelector(apiRef, selector, arguments, equals);
```

### Other exports

- `ariaV8` experimental flag is removed.
- `ariaV8` experimental flag is removed. It's now the default behavior.

<!-- ### Editing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ This change causes a few breaking changes:

return (
- <PickersLayoutRoot ownerState={props}>
+ <PickersLayoutRoot ownerState={ownerState}>
- <PickersLayoutContentWrapper>
+ <PickersLayoutRoot ownerState={ownerState}>
+ <PickersLayoutContentWrapper ownerState={ownerState}>
</PickersLayoutContentWrapper>
</PickersLayoutRoot>
Expand Down Expand Up @@ -455,8 +455,10 @@ This change causes a few breaking changes:

// This contains a small behavior change.
// If the picker is not controlled and has a default value,
// opening it and calling `acceptValueChanges` without any change will call `onAccept` with the default value.
// Whereas before, opening it and calling `onDimiss` without any change would not have called `onAccept`.
// opening it and calling `acceptValueChanges` without any change will call `onAccept`
// with the default value.
// Whereas before, opening it and calling `onDimiss` without any change would
// not have called `onAccept`.
-const { onDismiss } = props;
+const { acceptValueChanges } = usePickerActionsContext();
+const onDismiss = acceptValueChanges
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ This inconsistency has been solved, all the event manager now target the root of

```diff
-<SimpleTreeView>
+<SimpleTreeView onItemClick={handleItemClick}>
- <TreeItem onClick={handleItemClick}>
+<SimpleTreeView onItemClick={handleItemClick}>
+ <TreeItem>
</SimpleTreeView>
```
Expand Down
16 changes: 8 additions & 8 deletions docs/data/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,14 +585,14 @@ const pages: MuiPage[] = [
pathname: '/x/migration/migration-pickers-v7',
title: 'Breaking changes: Date and Time Pickers',
},
{
pathname: '/x/migration/migration-tree-view-v7',
title: 'Breaking changes: Tree View',
},
{
pathname: '/x/migration/migration-charts-v7',
title: 'Breaking changes: Charts',
},
{
pathname: '/x/migration/migration-tree-view-v7',
title: 'Breaking changes: Tree View',
},
],
},
{
Expand All @@ -604,14 +604,14 @@ const pages: MuiPage[] = [
pathname: '/x/migration/migration-pickers-v6',
title: 'Breaking changes: Date and Time Pickers',
},
{
pathname: '/x/migration/migration-tree-view-v6',
title: 'Breaking changes: Tree View',
},
{
pathname: '/x/migration/migration-charts-v6',
title: 'Breaking changes: Charts',
},
{
pathname: '/x/migration/migration-tree-view-v6',
title: 'Breaking changes: Tree View',
},
],
},
{
Expand Down
6 changes: 3 additions & 3 deletions packages/x-data-grid/src/models/gridSlotsComponentsProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,16 @@ interface ElementSlotProps {
skeletonCell: GridSkeletonCellProps & SkeletonCellPropsOverrides;
toolbar: GridToolbarProps & ToolbarPropsOverrides;
/**
* Props passed to the `.main` (role="grid") element
* Props passed to the `.main` (role="grid") element.
*/
main: MainProps;
/**
* Props passed to the `.root` element
* Props passed to the `.root` element.
*/
root: RootProps;
}

/* Merge MUI types into base types to keep slotProps working. */
// Merge MUI types into base types to keep slotProps working.
type Merge<A, B> = {
[K in keyof A | keyof B]: K extends keyof A & keyof B
? A[K] & B[K]
Expand Down

0 comments on commit dac7c3d

Please sign in to comment.