-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Stepper] Difficult to compose without learning implementation details #21326
Comments
@Floriferous Agree, it's much easier to use the context now than it was when first designing the component (2017). It's related to #12921. @eps1lon made some progress on it lately #18085. Would you be interested in trying that out? |
@oliviertassinari I would give it a try :) |
@baterson Great, note that it's a larger effort than previously. I think that the first step will be to update all the stepper tests to use testing-library. Then, we can actually look at changing the implementation. |
@oliviertassinari Ok then. I'll start with tests first. |
@baterson Thanks, the reason is that shallow and .find(ComponentName) will be bottlenecks in the update of the implementation. Ideally, we would like to be able to update the implementation without changing a single test. |
@oliviertassinari I'm a bit confused on tests like this one: |
Agree, I think that using the Step would make more sense here. |
Is this expected to be a breaking change, and not be available until v5? We have a use case to make the steps reorder-able, which is proving to be very difficult while the |
@mymattcarroll all ongoing development is on v5, yes. We still plan to make releases every week along the way to a stable state. |
I've been struggling to use the
Stepper
component, as it seems to rely a lot on refs andReact.cloneElement
. This means that you can't simply compose the component together, as you need to know where and what-for refs, passed props are needed.Here's a simple reproduction: https://stackblitz.com/edit/w2vekn
I've had to look around multiple files in the Stepper* tree to understand that you can fix the first example by passing any props along to the
StepLabel
.I think it'd be simpler if the component used context instead of
cloneElement
.The same visual glitches happen if you were to try to pull the
Step
component inside your own custom one and give that custom component as children toStepper
, if you do that, then you lose the connector.The text was updated successfully, but these errors were encountered: