Skip to content

Commit

Permalink
[docs] Fix typo in migration guide (#15508)
Browse files Browse the repository at this point in the history
Signed-off-by: Flavien DELANGLE <[email protected]>
Co-authored-by: Lukas Tyla <[email protected]>
  • Loading branch information
flaviendelangle and LukasTy authored Nov 20, 2024
1 parent 6fc6978 commit 6e21fb6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/data/migration/migration-pickers-v7/migration-pickers-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,41 +258,41 @@ const theme = createTheme({

### Slot: `layout`

- The component passed to the `layout` slot no longer receives a `disabled` prop, instead you can use the `usePickersContext` hook:
- The component passed to the `layout` slot no longer receives a `disabled` prop, instead you can use the `usePickerContext` hook:

```diff
-console.log(props.disabled);
+import { usePickersContext } from '@mui/x-date-pickers/hooks';
+const { disabled } = usePickersContext();
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
+const { disabled } = usePickerContext();
+console.log(disabled);
```

- The component passed to the `layout` slot no longer receives a `readOnly` prop, instead you can use the `usePickersContext` hook:
- The component passed to the `layout` slot no longer receives a `readOnly` prop, instead you can use the `usePickerContext` hook:

```diff
-console.log(props.readOnly);
+import { usePickersContext } from '@mui/x-date-pickers/hooks';
+const { readOnly } = usePickersContext();
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
+const { readOnly } = usePickerContext();
+console.log(readOnly);
```

### Slot: `toolbar`

- The component passed to the `toolbar` slot no longer receives a `disabled` prop, instead you can use the `usePickersContext` hook:
- The component passed to the `toolbar` slot no longer receives a `disabled` prop, instead you can use the `usePickerContext` hook:

```diff
-console.log(props.disabled);
+import { usePickersContext } from '@mui/x-date-pickers/hooks';
+const { disabled } = usePickersContext();
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
+const { disabled } = usePickerContext();
+console.log(disabled);
```

- The component passed to the `toolbar` slot no longer receives a `readOnly` prop, instead you can use the `usePickersContext` hook:
- The component passed to the `toolbar` slot no longer receives a `readOnly` prop, instead you can use the `usePickerContext` hook:

```diff
-console.log(props.readOnly);
+import { usePickersContext } from '@mui/x-date-pickers/hooks';
+const { readOnly } = usePickersContext();
+import { usePickerContext } from '@mui/x-date-pickers/hooks';
+const { readOnly } = usePickerContext();
+console.log(readOnly);
```

Expand Down

0 comments on commit 6e21fb6

Please sign in to comment.