From adf5e908b56b94131e0e6e990ba456f33e1c92a2 Mon Sep 17 00:00:00 2001 From: jonathanmos Date: Tue, 16 Nov 2021 10:34:56 +0200 Subject: [PATCH] Fix RetryableMountingException from Switch Summary: Changelog: Change useLayoutEffect to useEffect to fix #32594 (stuck operation in viewcommands list in Android Release) --- Libraries/Components/Switch/Switch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index abb7f00b761df7..91ba3dec854994 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -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.