Skip to content

Conversation

@WilcoBakker
Copy link

As described by issue #3709, starting with React 19.2, the OneTimePasswordField component no longer functions properly.

The issue being React's useEffectEvent hook being used to define the dispatch function instead of using React's useCallback hook which allows dependencies to be supplied. Particularly the collection state value wouldn't update properly causing the value inside the dispatch function to be out of sync with the latest state.

React 19.1:

524183999-bfd4b6a3-f23d-4197-a3ca-118cf784d67a

React 19.2:

524184971-f99da422-f13e-4e5d-980f-60e42750b9f3

Caveats of the useEffectEvent hook according the documentation of React:

524189928-ca5b67c5-a570-40e5-9aec-2a8fd7fef859

So I have updated the dispatch to make use of React's useCallback hook instead restoring the functionality of OneTimePasswordField.

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 36447a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@radix-ui/react-one-time-password-field Patch
radix-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant