Replies: 2 comments 3 replies
-
Did the config prop go away? If so, would the navigation stuff (component, and location) just be hand rolled rather than configured by the wrapper? Also, is there documentation on the props? (config, etc) I had something like this before:
I am glad you are still working on this. Thank you for all your hard work! |
Beta Was this translation helpful? Give feedback.
-
Hello @coltanium13, thank you for using the library and giving feedback. I really appreciate it.
Yes, config prop is not a thing anymore. Thanks to the power of composition, you can place your Navigation anywhere in your code. Just pull the methods you need (next, prev, etc.) from
Steps only accepts In your current code, instead of passing config object, you can directly render them inside return statement. Just make sure that if you are using any property that exists in Here I quickly refactored the code you shared: const stepsConfig = useSteps();
return (
<>
<Steps>
{uniq(steps).map((step) => step)}
</Steps>
<StepNavigation
{...stepsConfig} // make sure renamed and removed properties are not used in StepNavigation component
isSaving={props.isSavingChanges}
validateForm={props.validateForm}
submitAccount={props.submitAccount}
addressWasUpdated={props.addressWasUpdated}
setAddressWasUpdated={props.setAddressWasUpdated}
/>
</>
); One last thing, make sure you wrap this component with |
Beta Was this translation helpful? Give feedback.
-
This version is a major upgrade that removes some parts of the library and introduces some breaking changes.
Step
component is removed. Direct siblings ofSteps
component will be treated as a new step.StepsProvider
should wrap the component that rendersSteps
component. For example, ifSteps
component is rendered inApp
component, andApp
is rendered inindex.js
file,<App/>
should be wrapped withStepsProvider
inindex.js
file.next
,prev
,isFirst
,isLast
should be accessed usinguseSteps
hook.For more details, please check the documentation.
This discussion was created from the release Version 3.
Beta Was this translation helpful? Give feedback.
All reactions