-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Switch Component intermittently not responding #11110
Comments
RNW uses the XAML ToggleSwitch control, which also exhibits this behavior if you click fast enough. So this might not be RNW specific. This may be exacerbated by running a Debug build. Does this repro in Release? |
I believe this may have to do with the fact that it's a controlled component. There should probably be a native event count (similar to the eventCount prop on TextInput) to ensure that stale JS update does not overwrite a recent update from native. I think what can happen is:
I think this would happen if assuming state setters aren't batched, but IIRC they are, so it wouldn't make a lot of sense that step 4 would fire the command (assuming the native state update matches the value update in the same batch). |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
I have tried reproduction steps listed above and debugged. |
Somehow, https://github.com/facebook/react-native/blob/main/Libraries/Components/Switch/Switch.js#L162 |
Not something we plan to address on the Paper renderer as we move towards Fabric. |
Problem Description
Switch component is not responding to click intermittently
RNSwitchFailure_Trim.mp4
Steps To Reproduce
Expected Results
Switch component to respond all the time
CLI version
npx react-native --version
Environment
Target Platform Version
None
Target Device(s)
No response
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
The text was updated successfully, but these errors were encountered: