[TouchRipple] Convert to function component#16522
Conversation
|
@material-ui/core: parsed: -0.08% 😍, gzip: -0.18% 😍 Details of bundle changes.Comparing: f3383e8...9edddc7
|
|
Any ideas on how to fix the |
|
Should it close #15231? |
c8957e0 to
303b5ad
Compare
745fc74 to
5890bea
Compare
5890bea to
9abc9b1
Compare
There was a problem hiding this comment.
I'm so happy to see the hooks milestone soon come to an end. It will free us time to undertake new efforts :).
For the ref part. I don't have a strong preference for any strategy. I have never seen anyone use the TouchRipple directly, but it's always possible. I would hope people use the ButtonBase if they need a ripple animation. TouchRippleProps was allowed for CSS customization (as far as I remember). The fact that people have to import the component with @material-ui/core/ButtonBase/TouchRipple is concerning. The other face that it's not exported in the index.j barrel could suggest that the component is in a weird semi-private/public state.
The ref part is in fact required by the Agree with the TouchRippleProps part. Those should not be exposed since we already have utility props in the form of |
bc5c63d to
9abc9b1
Compare
|
Got an idea for the test. I'm not a fan of abstracting assertions. These are comfortable for writing but make reading difficult. Code should be optimized for readability. |
@eps1lon This is an interesting topic! I would argue that it depends on the context. I see a couple of different cases for us:
This is based on my own experience, not a source of truth, the point I want to make is that we might have to balance between 3 states.
Does it make sense, do you see a flaw in this reasoning? |
No other than it's just guesswork. Just wondering why you wrote this down since it agrees with everything I said. It even doubles down by arguing users read our source code 100x more which means readable code is even more important. So I'm not sure what you're trying say other than: I agree. |
|
Ok, perfect, we are aligned. |
Last component conversion for #15231