Skip to content

Wizard - Set initial state for all steps #1335

Discussion options

You must be logged in to vote

@edhollinghurst Hi. Yes, it is very much possible. You have to use the initialValues prop on the form renderer to set initial values globally. The initial value used in a schema field will only appear in the form state once the field is registered to the form for the first time.

You can check this example, which is just a fork of yours: https://codesandbox.io/s/react-form-renderer-wizard-forked-o0hr15
The only change I made is taking the initialValues from your fields in the schema and passing them as a prop to the renderer.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@edhollinghurst
Comment options

Answer selected by edhollinghurst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants