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

[core] Add sections to some of the feature hooks #3391

Merged
merged 4 commits into from
Dec 14, 2021

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Dec 10, 2021

Those sections aim at improving the readability of the hooks, especially the big one and to ensure that the definition order is correct (we should always define the API methods before the events or the useFirstRender for instance, to avoid edge-cases where an API methods is called before its definition.

useGridFilter

Copy / paste

useGridColumnMenu

Copy / paste + typing

  • Add API method typing with React.useCallback<GridColumnMenuApi['someMethod']>
  • Add hook sections API METHODS / ``EVENTS`

useGridColumns

Copy / paste

  • Add hook sections API METHODS / EVENTS

useGridPage

Copy / paste

  • Add hook sections API METHODS / EFFECTS / EVENTS

useGridPageSize

Copy / paste

  • Add hook sections API METHODS / EFFECTS / EVENTS

useGridSelection

Copy / paste + small improvement

  • Add hook sections PRE-PROCESSINGS / API METHODS / EVENTS / EFFECTS
  • Use useGridRegisterPreProcessor instead of manually registering the pre-processing

@flaviendelangle flaviendelangle added the core Infrastructure work going on behind the scenes label Dec 10, 2021
@flaviendelangle flaviendelangle self-assigned this Dec 10, 2021
@flaviendelangle flaviendelangle changed the title [core] Add section to useGridFilter / useGridPage / useGridPageSize / useGridColumnMenu and useGridSelection [core] Add sections to some of the feature hooks Dec 10, 2021
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 14, 2021
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 14, 2021
@flaviendelangle flaviendelangle merged commit a0dbe75 into mui:master Dec 14, 2021
@flaviendelangle flaviendelangle deleted the hooks-structure branch December 14, 2021 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants