Skip to content

Commit 2cc9bc8

Browse files
[docs] Unify the wording of the pickers slots breaking changes (mui#16036)
1 parent e283172 commit 2cc9bc8

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

docs/data/migration/migration-pickers-v7/migration-pickers-v7.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ This change causes a few breaking changes:
364364
);
365365
```
366366

367-
- The component passed to the `layout` slot no longer receives the `value` prop, instead you can use the `usePickerContext` hook:
367+
- The component passed to the `layout` slot no longer receives the `value` prop.
368+
You can use the `usePickerContext` hook instead:
368369

369370
```diff
370371
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -377,7 +378,8 @@ This change causes a few breaking changes:
377378
+const { value } = usePickerContext();
378379
```
379380

380-
- The component passed to the `layout` slot no longer receives the `disabled` and `readOnly` props, instead you can use the `usePickerContext` hook:
381+
- The component passed to the `layout` slot no longer receives the `disabled` and `readOnly` props.
382+
You can use the `usePickerContext` hook instead:
381383

382384
```diff
383385
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -389,7 +391,8 @@ This change causes a few breaking changes:
389391
+const { readOnly } = usePickerContext();
390392
```
391393

392-
- The component passed to the `layout` slot no longer receives the `isRtl` prop. If you need to access this information, you can use the `useRtl` hook from `@mui/system`:
394+
- The component passed to the `layout` slot no longer receives the `isRtl` prop.
395+
You can use the `useRtl` hook from `@mui/system` instead:
393396

394397
```diff
395398
+import { useRtl } from '@mui/system/RtlProvider';
@@ -398,7 +401,8 @@ This change causes a few breaking changes:
398401
+ const isRtl = useRtl();
399402
```
400403

401-
- The component passed to the `layout` slot no longer receives the `orientation` and `isLandscape` props, instead you can use the `usePickerContext` hook:
404+
- The component passed to the `layout` slot no longer receives the `orientation` and `isLandscape` props.
405+
You can use the `usePickerContext` hook instead:
402406

403407
```diff
404408
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -411,7 +415,8 @@ This change causes a few breaking changes:
411415
+const isLandscape = orientation === 'landscape';
412416
```
413417

414-
- The component passed to the `layout` slot no longer receives the `wrapperVariant` prop, instead you can use the `usePickerContext` hook:
418+
- The component passed to the `layout` slot no longer receives the `wrapperVariant` prop.
419+
You can use the `usePickerContext` hook instead:
415420

416421
```diff
417422
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -420,7 +425,8 @@ This change causes a few breaking changes:
420425
+const { variant } = usePickerContext();
421426
```
422427

423-
- The component passed to the `layout` slot no longer receives the `view`, `views` and `onViewChange` props, instead you can use the `usePickerContext` hook:
428+
- The component passed to the `layout` slot no longer receives the `view`, `views` and `onViewChange` props.
429+
You can use the `usePickerContext` hook instead:
424430

425431
```diff
426432
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -497,7 +503,8 @@ This change causes a few breaking changes:
497503

498504
### Slot: `toolbar`
499505

500-
- The component passed to the `toolbar` slot no longer receives the `value` prop, instead you can use the `usePickerContext` hook:
506+
- The component passed to the `toolbar` slot no longer receives the `value` prop.
507+
You can use the `usePickerContext` hook instead:
501508

502509
```diff
503510
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -510,7 +517,8 @@ This change causes a few breaking changes:
510517
+const { value } = usePickerContext();
511518
```
512519

513-
- The component passed to the `toolbar` slot no longer receives the `disabled` and `readOnly` props, instead you can use the `usePickerContext` hook:
520+
- The component passed to the `toolbar` slot no longer receives the `disabled` and `readOnly` props.
521+
You can use the `usePickerContext` hook instead:
514522

515523
```diff
516524
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -522,7 +530,8 @@ This change causes a few breaking changes:
522530
+const { readOnly } = usePickerContext();
523531
```
524532

525-
- The component passed to the `toolbar` slot no longer receives the `isLandscape` prop, instead you can use the `usePickerContext` hook:
533+
- The component passed to the `toolbar` slot no longer receives the `isLandscape` prop.
534+
You can use the `usePickerContext` hook instead:
526535

527536
```diff
528537
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -532,7 +541,8 @@ This change causes a few breaking changes:
532541
+const isLandscape = orientation === 'landscape';
533542
```
534543

535-
- The component passed to the `toolbar` slot no longer receives the `view`, `views` and `onViewChange` props, instead you can use the `usePickerContext` hook:
544+
- The component passed to the `toolbar` slot no longer receives the `view`, `views` and `onViewChange` props.
545+
You can use the `usePickerContext` hook instead:
536546

537547
```diff
538548
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -568,7 +578,8 @@ This change causes a few breaking changes:
568578

569579
### Slot: `tabs`
570580

571-
- The component passed to the `tabs` slot no longer receives the `view`, `views` and `onViewChange` props, instead you can use the `usePickerContext` hook:
581+
- The component passed to the `tabs` slot no longer receives the `view`, `views` and `onViewChange` props.
582+
You can use the `usePickerContext` hook instead:
572583

573584
```diff
574585
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -611,7 +622,8 @@ This change causes a few breaking changes:
611622

612623
### Slot: `shortcuts`
613624

614-
- The component passed to the `shortcuts` slot no longer receives the `isLandscape` prop, instead you can use the `usePickerContext` hook:
625+
- The component passed to the `shortcuts` slot no longer receives the `isLandscape` prop.
626+
You can use the `usePickerContext` hook instead:
615627

616628
```diff
617629
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
@@ -636,7 +648,8 @@ This change causes a few breaking changes:
636648
The only difference is that `usePickerActionsContext` only contains variables with stable references that won't cause a re-render of your component.
637649
:::
638650

639-
- The component passed to the `shortcuts` slot no longer receives the `isValid` prop, instead you can use the `useIsValidValue` hook:
651+
- The component passed to the `shortcuts` slot no longer receives the `isValid` prop.
652+
You can use the `useIsValidValue` hook instead:
640653

641654
```diff
642655
+import { useIsValidValue } from '@mui/x-date-pickers/hooks';

0 commit comments

Comments
 (0)