brock-noah / react-whatever-wizard Goto Github PK
View Code? Open in Web Editor NEWdeclarative, component based, multistep manager
declarative, component based, multistep manager
Having a prop of props seems smelly.
<WW>
<Step componentClass={YourStepOne} componentProps={{color: 'blue'}}>
<StepButton />
</Step>
</WW>
React.createElement
<WW>
<Step>
<YourStepOne color="blue">
<StepButton />
</YourStepOne>
</Step>
</WW>
How would this work with layout component? Does layoutComponent wrap all the steps? How does each step override the default props for the layout? Another prop of props, or wrap each step in layoutComponent.
<WW layoutComponent={YourLayout} layoutProps='Enter Contact Info'>
<Step componentClass={YourStepOne} componentProps={{color: 'blue'}}>
<StepButton />
</Step>
</WW>
<WW>
<YourLayout title='Enter Your Contact Info'>
<Step>
<YourStepOne color="blue">
<StepButton />
</YourStepOne>
</Step>
<Step />
</YourLayout>
</WW>
Does it provide value?
Should Step
map the children providing more props to StepButton
?
Are any of the following useful to a single standalone button?
Seems to not work
Both the StepButton
and your component button will need props. How should we separate these to avoid prop name conflicts.
<StepButton
role="next"
componentClass="button"
componentProps={ {disabled} }
/>
<StepButton
wwProps={ {role: "next"} }
componentClass="button"
disabled
/>
_role
or ww-role
Look at route for React.Children.map instead of Array.reduce
create-react-app
react-whatever-wizard
coderole
handles changes which step it is
role
fires, then button onClick
onClick
fires, then role
onClick
receives the role
function as an argument, deciding if it should be calledStepButton.onClick.PropTypes.oneOf(['next', 'back', function])
onClick
, only role
firesA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.