Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix useMountedState in hooks.ts not correct init leavingRef in StrictMode. #292

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

molinla
Copy link
Contributor

@molinla molinla commented Oct 19, 2024

Overview

this pr is about fix hooks.ts useMountedState not working correctly in React 18 with StrictMode.
StrictMode will render component twice, but in useMountedState do not have code to re-init leavingRef when mounted again.

Reference:

Case

when i using Picker component, its data will not correctly updated after select PickerCell items.

Issue

related #291

Effected Component

  • image
  • picker-view
  • popover

…value in React 18 StrictMode

(cherry picked from commit e18d76c)
@adaex adaex requested a review from Copilot November 20, 2024 03:17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.

Copy link
Contributor Author

@molinla molinla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ziqisia ziqisia merged commit af2bf5d into arco-design:main Nov 21, 2024
1 check passed
@molinla molinla deleted the fix-use-mounted-state branch November 21, 2024 07:09
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.

4 participants