Skip to content

Fix FormState.values type to be non-optional#502

Merged
erikras merged 1 commit into
final-form:mainfrom
JonathanWbn:fix-formstate-values-type
Sep 3, 2025
Merged

Fix FormState.values type to be non-optional#502
erikras merged 1 commit into
final-form:mainfrom
JonathanWbn:fix-formstate-values-type

Conversation

@JonathanWbn

Copy link
Copy Markdown
Contributor

Summary

• Fix FormState.values type definition to be non-optional
• Resolves TypeScript errors in v5 where consumers expect values to always be present

Fixes #501

Test plan

  • All existing tests pass
  • TypeScript compilation succeeds
  • FormState.values is consistent with internal implementation where it's always initialized

FormState.values was incorrectly marked as optional in the TypeScript
migration, but it's always initialized in the internal implementation
and should never be undefined. This fixes type errors in v5 where
consumers expect values to always be present.
@JonathanWbn
JonathanWbn marked this pull request as ready for review June 13, 2025 19:56
@tutturen

tutturen commented Jul 9, 2025

Copy link
Copy Markdown

Thanks @JonathanWbn ! Would it be possible to get this merged @erikras ?
This fixes a small breaking change in 5.0 that makes a big difference for consumers of final-form.

@pkasarda

Copy link
Copy Markdown

@erikras can we please revert type changes to this file? :)

@erikras
erikras merged commit 8e873ad into final-form:main Sep 3, 2025
@AndrewShwets

Copy link
Copy Markdown

Still getting this issue on 5.0.0 because tag wasn't updated.
We have this fix in master, but no version update, so we pull old code

@lehos

lehos commented Sep 26, 2025

Copy link
Copy Markdown

@erikras can you make a release with this fix?

@Dozalex

Dozalex commented Mar 12, 2026

Copy link
Copy Markdown

@erikras any updates?

@erikras-richard-agent

Copy link
Copy Markdown
Contributor

Published in v5.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FormState values can be undefined in v5.0.0

8 participants