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

[DataGridPro] Remove function overloading for useGridApiRef #3666

Merged
merged 3 commits into from Jan 25, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jan 19, 2022

Part of #3208
Part of #3648

The goal here is to have a hook with a single interface. That way I can override the interface based on the package that is exporting it.

  • Remove the format useGridApiRef(apiRef); the hook now only create the ref but don't initialize it

  • Stop using the logger for the api initialization. I would like to drop this logger that nobody seems to use. But at 1st I removed it from useGridApiInitialization and its dependencies to be able to call useGridApiInitialization before useGridLoggerFactory and init the apiRef in it.

  • Init 100% of the apiRef inside the useGridApiInitialization

@mui-bot
Copy link

mui-bot commented Jan 19, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 135.9 252.9 234.4 211.04 45.459
Sort 100k rows ms 372.9 601.1 454.6 479.86 92.256
Select 100k rows ms 108.9 272.9 160.7 168.46 56.706
Deselect 100k rows ms 108 213.6 121.5 150.94 43.173

Generated by 🚫 dangerJS against 7035d40

@flaviendelangle flaviendelangle changed the title [DataGridPro] Remove function overloading for useGridApiRef [DataGridPro] Remove function overloading for useGridApiRef Jan 21, 2022
@michael-land
Copy link

michael-land commented Feb 3, 2022

@flaviendelangle Could you guild me how to migrate from const apiRef = useGridApiRef(customApiRef);?

Which hook should I use if I want to pass custom apiRef from parent component?

@flaviendelangle
Copy link
Member Author

Here is a working example

This part was meant to be private, sorry if it was unclear and we removed it during a minor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants