You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
+71-1
Original file line number
Diff line number
Diff line change
@@ -393,7 +393,7 @@ This change causes a few breaking changes:
393
393
}
394
394
```
395
395
396
-
- The component passed to the `layout` slot no longer receives an`orientation` and the`isLandscape` props, instead you can use the `usePickerContext` hook:
396
+
- The component passed to the `layout` slot no longer receives the`orientation` and `isLandscape` props, instead you can use the `usePickerContext` hook:
397
397
398
398
```diff
399
399
-console.log(props.orientation);
@@ -415,6 +415,51 @@ This change causes a few breaking changes:
415
415
+console.log(variant);
416
416
```
417
417
418
+
- The component passed to the `layout` slot no longer receives the `onClear`, `onSetToday`, `onAccept`, `onCancel`, `onOpen`, `onClose` and `onDismiss` props, instead you can use the `usePickerActionsContext` or the `usePickerContext` hooks:
419
+
420
+
```diff
421
+
+import { usePickerActionsContext } from '@mui/x-date-pickers/hooks';
The `usePickerContext` also contain all the actions returned by `usePickerActionsContext`.
460
+
The only difference is that `usePickerActionsContext` only contains variables with stable references that won't cause a re-render of your component.
461
+
:::
462
+
418
463
### Slot: `toolbar`
419
464
420
465
- The component passed to the `toolbar` slot no longer receives a `disabled` prop, instead you can use the `usePickerContext` hook:
@@ -435,6 +480,31 @@ This change causes a few breaking changes:
435
480
+console.log(readOnly);
436
481
```
437
482
483
+
### Slot: `actionBar`
484
+
485
+
- The component passed to the `actionBar` slot no longer receives the `onClear`, `onSetToday`, `onAccept` and `onCancel` props. You can use the `usePickerActionsContext` or the `usePickerContext` hooks instead:
486
+
487
+
```diff
488
+
+import { usePickerActionsContext } from '@mui/x-date-pickers/hooks';
0 commit comments