Skip to content

Commit

Permalink
Fix Switch causing RetryableMountingLayerException
Browse files Browse the repository at this point in the history
Summary:
Changelog:
Change useLayoutEffect to useEffect to fix facebook#32594 - stuck operation in mViewCommandOperations list in Android Release
  • Loading branch information
jonathanmos committed Nov 16, 2021
1 parent 1d6af14 commit d92ecda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/Components/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const SwitchWithForwardedRef: React.AbstractComponent<
setNative({value: event.nativeEvent.value});
};

React.useLayoutEffect(() => {
React.useEffect(() => {
// This is necessary in case native updates the switch and JS decides
// that the update should be ignored and we should stick with the value
// that we have in JS.
Expand Down

0 comments on commit d92ecda

Please sign in to comment.