-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
Migration to hooks #15231
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@joshwooding If you don't have any priority for specific components it would be nice to prioritize Tooltip (improves |
Luckily I've already done the majority of the Tooltip conversion :) |
Hi, @oliviertassinari I would like to try this for "Portal" component. Can I work on that if no one else has done it already? 😃 |
Unless @joshwooding has already done an effort in this direction, you are good to go :). |
@gautam-relayr Feel free :) |
Can I work on the |
Understood I'll have a look at the relevant PR's to understand what needs to be implemented for the Snackbar.
I must have missed them 😅 I'll have a look at it 👍 |
Is the makeStyles API stable or is it subject to change? We currently use withStyles on an internal app here at WalmartLabs but we are eager to start using more hooks APIs. |
@austingardner I have looked into it in #15023. I haven't seen any issue (aside from the default props + API generation). We haven't moved forward as it's not a priority for the project right now. I only wanted to evaluate the potential. It should be ✅. I hope we can automate the conversion post v4. Maybe with a codemod? @eps1lon has found an issue in StrictMode. The style sheets might not be removed from the DOM. Given withStyles uses makeStyles internally, everybody is impacted. So it shouldn't be a concern when choosing between withStyles and makeStyles. By the way, we have added WalmartLabs logo in https://next.material-ui.com/. Let us know if it's OK for your team :). |
@austingardner To answer your question. No, we don't plan on changing the API of makeStyles. |
@oliviertassinari Thanks for the response! We'll start using it then. |
@adeelibr I'd prefer if people pick up one component at a time, but feel free to help. :) |
ok, I analyzed your source code and use of npm module |
I'm taking care of the Slider. |
Some issues, I put the hooks and contextProvider (for width) in the package running tests now, i get the following errors
After installing all these modules with npm , (in the project root) I run
|
@jacobbogers You need to use |
Thanks, yes, I remember I came accorss this when I installed material-ui for the first time, sorry to have forgotten. |
Can someone check out my PR so far? |
Hi, Can I work on the ButtonBase component? |
@jeongsd ButtonBase is going to be one of the hardest components to migrate. I would start looking at SpeedDialAction instead |
Hi, Can I work on |
@adeelibr A previous effort started in #15469 (comment). |
Is |
Thanks for the guide @joshwooding, can I work on |
Is this task still up for grabs? I wouldn't mind taking it, if it's open 😃 |
Unless @joshwooding has something in store for it. It's up for grab :). |
@bpas247 No plans here :) Feel free! |
Hmm looking at the doc examples right now, it looks like most of the component examples have already migrated to function components. Are there any that haven’t? Or am I looking in the wrong directory for what the task is relevant to? |
This is one way to find them: https://github.com/mui-org/material-ui/search?l=JavaScript&p=1&q=%22React.Component%22. |
We've made a great start in the conversion to Function Components. This is just an issue to keep track of what we class components (public and internal) we have left. I haven't checked if it's feasible to convert these components, if it's necessary or if it's worth it.
Core
Lab
Won't migrate
Future work
The following items can be fully addressed once this effort is done:
withTheme()
withuseTheme()
withFormControlContext
[core] Use useFormControl instead of withFormControlState #16503withForwardedRef
[core] Batch small changes #16532useForkRef
over custom implementations.defaultProps
to function body [core] Remove all .defaultProps usages #16542The text was updated successfully, but these errors were encountered: