Skip to content

Prevent formState.values from initializing to undefined#450

Merged
erikras merged 1 commit into
final-form:mainfrom
mjchang:undefined-initialize-form-value
Apr 1, 2022
Merged

Prevent formState.values from initializing to undefined#450
erikras merged 1 commit into
final-form:mainfrom
mjchang:undefined-initialize-form-value

Conversation

@mjchang

@mjchang mjchang commented Mar 21, 2022

Copy link
Copy Markdown
Contributor

Resolve #449

The root of the problem is setIn returns undefined if you pass in an undefined value. I assume this is intentional so I just added the || {} to ensure that form.values can never be undefined.

@erikras
erikras merged commit 3af52bf into final-form:main Apr 1, 2022
@mjchang
mjchang deleted the undefined-initialize-form-value branch April 1, 2022 15:53
@mjchang

mjchang commented Apr 25, 2022

Copy link
Copy Markdown
Contributor Author

@erikras Can you make a release that includes a fix for this?

@erikras

erikras commented Apr 27, 2022

Copy link
Copy Markdown
Member

Published in v4.20.7.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keepDirtyOnReinitialize can't handle undefined value

2 participants