Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Differentiate between packages in slotProps docs #9668

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

cherniavskii
Copy link
Member

@cherniavskii cherniavskii commented Jul 13, 2023

We got this feedback recently:

The code example isn't correct. You should add

import '@mui/x-data-grid-pro'

to the augmentation file. It won't work otherwise.

While I couldn't reproduce the issue, it makes sense to augment the package that you actually use.

Preview: https://deploy-preview-9668--material-ui-x.netlify.app/x/react-data-grid/components/#custom-slot-props-with-typescript

@cherniavskii cherniavskii added docs Improvements or additions to the documentation component: data grid This is the name of the generic UI component, not the React module! labels Jul 13, 2023
@mui-bot
Copy link

mui-bot commented Jul 13, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-9668--material-ui-x.netlify.app/

Updated pages

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 313.1 570.6 351.2 406.82 103.336
Sort 100k rows ms 408.7 871.8 831.3 719.8 181.523
Select 100k rows ms 187.1 260.4 214.5 222.06 30.777
Deselect 100k rows ms 119.4 225.2 216.9 183.64 44.834

Generated by 🚫 dangerJS against bd09ccc

Copy link
Member

@MBilalShafi MBilalShafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice. <codeblock /> is actually cool. 🧊

@cherniavskii
Copy link
Member Author

@alexfauquette Thanks for your work on codeblocks! 🎉

@@ -184,8 +184,10 @@ For example, for `columnMenu` slot, the interface name would be `ColumnMenuProps

This [file](https://github.com/mui/mui-x/blob/-/packages/grid/x-data-grid/src/models/gridSlotsComponentsProps.ts) lists all the interfaces for each slot which could be used for augmentation.

```tsx
// augment the props for `toolbar` slot
<codeblock storageKey="data-grid-pricing-plan">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hesitating to say that we don't need a storage key for this

Suggested change
<codeblock storageKey="data-grid-pricing-plan">
<codeblock>

but maybe we do, a general one seems more appropriate.

Suggested change
<codeblock storageKey="data-grid-pricing-plan">
<codeblock storageKey="pricing-plan">

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that was my initial thought, but then I thought it might be better to have a separate key for the data grid and pickers because there's no Premium plan in pickers. With separate storage keys, you can have Pro for the pickers and Premium for the grid.
Not a strong opinion though 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have special handling for this case in the docs-infra.

@cherniavskii cherniavskii marked this pull request as ready for review July 21, 2023 15:06
@cherniavskii cherniavskii merged commit e3932b3 into mui:master Jul 21, 2023
17 checks passed
@cherniavskii cherniavskii deleted the slotProps-ts-overrides-docs branch July 21, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants