-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[core] Use a pipe processor for GridPreferencePanel
children
#4216
Conversation
GridPreferencePanel
children
These are the results for the performance tests:
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
{...rootProps.componentsProps?.basePopper} | ||
> | ||
{!rootProps.disableColumnSelector && isColumnsTabOpen && ( | ||
<rootProps.components.ColumnsPanel {...rootProps.componentsProps?.columnsPanel} /> | ||
)} | ||
|
||
{!rootProps.disableColumnFilter && isFiltersTabOpen && ( | ||
<rootProps.components.FilterPanel {...rootProps.componentsProps?.filterPanel} /> | ||
{apiRef.current.unstable_applyPreProcessors( | ||
'preferencePanel', | ||
null, | ||
preferencePanelState.openedPanelValue ?? GridPreferencePanelsValue.filters, | ||
)} | ||
</rootProps.components.Panel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit weird to see apiRef.current.unstable_applyPreProcessors
called inside the rendering
Could be more readable as follow, but not 100% sure it's the same
const panelContent = apiRef.current.unstable_applyPreProcessors(...);
...
<rootProps.components.Panel ...>
{panelContent}
</rootProps.components.Panel>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the same yes
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you lucky-luke? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I was a bit confused with applyPreprocessors
. From the name I thought it was kind of a reducer which applies all preprocess methods on state data. I did not realise it could also return a value
I plan to rename all this pre-processing code to |
Extracted from #4208
If we want to add a preference panel from a pro / premium feature, we are currently stuck.
Maybe we need to change the whole approach of the preference panel at some point, but this PRs should not introduce any breaking change.