[Stepper] Difficult to compose without learning implementation details
See original GitHub issueI’ve been struggling to use the Stepper
component, as it seems to rely a lot on refs and React.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 to Stepper
, if you do that, then you lose the connector.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9 (8 by maintainers)
Top Results From Across the Web
[Stepper] Difficult to compose without learning implementation ...
I've been struggling to use the Stepper component, as it seems to rely a lot on refs and React.cloneElement. This means that you...
Read more >Design Guidelines for Input Steppers - Nielsen Norman Group
Implement input steppers for those fields that have a clear, preferred value that users will adjust only slightly. Stepper segments should be ...
Read more >Stepper Motors and Arduino - The Ultimate Guide
In this tutorial we will learn everything we need to know about controlling stepper motors with Arduino and the A4988, DRV8825 and TMC2208....
Read more >Flutter - Stepper Widget - GeeksforGeeks
In this article, we will learn about the Stepper widget in Flutter. A stepper widget displays progress through a sequence of steps.
Read more >How to Get Better at Music Composition (15 Do's and 5 Don'ts)
The short answer to get better at music composition is simply "practice". Just like anything else, the more you do it the better...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agree, I think that using the Step would make more sense here.
@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.