Skip to content

fix(TokenizedInput): handle strict mode double init correctly#382

Merged
gearoffortune merged 1 commit into
mainfrom
tokenized-input-strict
May 14, 2026
Merged

fix(TokenizedInput): handle strict mode double init correctly#382
gearoffortune merged 1 commit into
mainfrom
tokenized-input-strict

Conversation

@gearoffortune
Copy link
Copy Markdown
Contributor

@gearoffortune gearoffortune commented May 14, 2026

In strict mode, ref gets inited with true, then the useEffect on (simulated) mount runs, then simulated unmount runs cleanup function and sets it to false, and then during actual mount nothing happens.
So in strict mode, we get true -> false -> false, and during requests, they always get cancelled
For original context, see https://github.com/gravity-ui/components/pull/375/changes#r3000119161

@gravity-ui-bot
Copy link
Copy Markdown
Contributor

Preview is ready.

@gearoffortune gearoffortune marked this pull request as ready for review May 14, 2026 10:57
@gearoffortune gearoffortune merged commit 9b8cd89 into main May 14, 2026
4 checks passed
@gearoffortune gearoffortune deleted the tokenized-input-strict branch May 14, 2026 11:21
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.

3 participants