Skip to content

[docs] Migrate all public class component to function components#16693

Merged
joshwooding merged 29 commits into
mui:masterfrom
bpas247:feat/migrate-component-examples-to-function
Jul 29, 2019
Merged

[docs] Migrate all public class component to function components#16693
joshwooding merged 29 commits into
mui:masterfrom
bpas247:feat/migrate-component-examples-to-function

Conversation

@bpas247

@bpas247 bpas247 commented Jul 23, 2019

Copy link
Copy Markdown
Contributor

My first pass-through of migrating all of the remaining class
component doc examples to function components via hooks.

Current list of class component doc examples that will need to be migrated:

Note: Please let me know if I'm missing any components here 😃

Since this is the last task on the issue:

closes #15231

The first passthrough of migrating all of the remaining class
component doc examples to function components via hooks.
@mui-pr-bot

mui-pr-bot commented Jul 23, 2019

Copy link
Copy Markdown

No bundle size changes comparing 8c28ed9...45786d3

Generated by 🚫 dangerJS against 45786d3

@oliviertassinari oliviertassinari changed the title feat: Migrate remaining class component doc examples to function components [docs] Migrate remaining class component to function components Jul 23, 2019
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation. label Jul 23, 2019
@bpas247
bpas247 marked this pull request as ready for review July 24, 2019 02:50
@bpas247

bpas247 commented Jul 24, 2019

Copy link
Copy Markdown
Contributor Author

Marking this as ready for review now, since I have migrated all of the class components I could find.

bpas247 added 2 commits July 23, 2019 20:13
There should be a check to see if messageInfo is defined first,
before trying to access a property on it.

@joshwooding joshwooding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work, I haven’t marked all the things that should change but the main things I’ve spotted are changing withStyles to useStyles where possible and using the function variant of setting state.

Comment thread docs/src/pages/components/breadcrumbs/RouterBreadcrumbs.js Outdated
Comment thread docs/src/pages/components/breadcrumbs/RouterBreadcrumbs.js Outdated
Comment thread docs/src/pages/components/popper/ScrollPlayground.js Outdated
Comment thread docs/src/pages/components/popper/ScrollPlayground.js Outdated
Comment thread docs/src/pages/components/snackbars/ConsecutiveSnackbars.js Outdated
Comment thread docs/src/pages/components/speed-dial/OpenIconSpeedDial.js Outdated
Comment thread docs/src/pages/components/speed-dial/OpenIconSpeedDial.js Outdated
Comment thread docs/src/pages/components/popper/ScrollPlayground.js Outdated
Comment thread docs/src/pages/components/snackbars/DirectionSnackbar.tsx
@oliviertassinari oliviertassinari changed the title [docs] Migrate remaining class component to function components [docs] Migrate 11 class component to function components Jul 25, 2019
bpas247 added 2 commits July 25, 2019 03:19
I decided to remove the memoization entirely, as it might not be
neccessary for this doc example.
Also improved the consistency of the Composition docs.
Comment thread docs/src/pages/guides/composition/composition.md
Comment thread docs/src/pages/components/snackbars/ConsecutiveSnackbars.js Outdated
Comment thread docs/src/pages/components/snackbars/ConsecutiveSnackbars.tsx Outdated
Comment thread docs/src/pages/components/speed-dial/SpeedDialTooltipOpen.js Outdated
Comment thread docs/src/pages/components/speed-dial/SpeedDials.js Outdated

@joshwooding joshwooding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nearly there :)

@joshwooding joshwooding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A few more.

Comment thread docs/src/pages/components/snackbars/ConsecutiveSnackbars.js Outdated
Comment thread docs/src/pages/components/snackbars/ConsecutiveSnackbars.tsx Outdated
Comment thread docs/src/pages/components/snackbars/ConsecutiveSnackbars.tsx Outdated
Comment thread docs/src/pages/customization/components/DynamicCSSVariables.js Outdated
Comment thread docs/src/pages/customization/components/DynamicClassName.js Outdated
bpas247 and others added 2 commits July 27, 2019 12:42
Simplify Dynamic CSS doc examples to use hooks for styling,
and fix Consecutive Snackbars TS temo

@joshwooding joshwooding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice Job!

@bpas247

bpas247 commented Jul 27, 2019

Copy link
Copy Markdown
Contributor Author

Thanks a bunch for the reviews everyone 😃 this was a lot of fun to work on and I learned a few new things in the process 😎

Comment thread docs/src/pages/components/dialogs/CustomizedDialogs.js Outdated
Comment thread docs/src/pages/components/snackbars/DirectionSnackbar.js Outdated
Comment thread docs/src/pages/components/snackbars/DirectionSnackbar.tsx Outdated
Comment thread docs/src/pages/customization/components/DynamicCSS.js Outdated
Comment thread docs/src/pages/customization/components/DynamicCSSVariables.js Outdated
Comment thread docs/src/pages/customization/components/DynamicClassName.js Outdated
Comment thread docs/src/pages/customization/components/DynamicThemeNesting.js Outdated
@joshwooding
joshwooding merged commit a481995 into mui:master Jul 29, 2019
@joshwooding

Copy link
Copy Markdown
Collaborator

@bpas247 Good Job 👍

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

Labels

docs Improvements or additions to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration to hooks

6 participants