Skip to content

Setters after initializing values #1258

Answered by Hyperkid123
Ali-Zmn asked this question in Need help
Discussion options

You must be logged in to vote

@Ali-Zmn We are just looking at your example and we have found the issue.

The good news is we can fix your example. If you remove the initializeOnMount from your schema version, the setters start to behave as they should.

    {
      component: "textField",
      name: "schemaVersion",
      initialValue: "1.1.0",
-     initializeOnMount: true,
      hideField: true
    }

So why is this happening? Due to final form limitations, we have to call the change method for fields with this flag. This will mark the for as modified, opening the gates for setters.

So you will have to set the value somewhere else. Preferably in your initial values object that you feed to the renderer.

The bad news is…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
2 replies
@Ali-Zmn
Comment options

@Hyperkid123
Comment options

Comment options

You must be logged in to vote
3 replies
@rvsia
Comment options

@rvsia
Comment options

@Hyperkid123
Comment options

Comment options

You must be logged in to vote
4 replies
@Ali-Zmn
Comment options

@Hyperkid123
Comment options

@Ali-Zmn
Comment options

@Hyperkid123
Comment options

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