-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
Warning: Cannot update a component (Button
) while rendering a different component (Button
).
#1828
Comments
I also encounter this issue:
|
Yes, when I fixed the regression causing super slow theme changes these came back (the back and forth of fixing bugs :/). For some reason web is super fast and doesn't mind queueMicrotask but native does. I think there's some flag in Hermes you have to enable to make microtasks work like they should or something. Anyway the error isn't harmful just annoying. I will fix it soon. |
I'm having this issue as well. I've been trying to figure out it but couldn't find anything helpful yet. The first thing that I noticed is that; my button element was like that
After I removed I am not sure why that argument for Button component was making a trouble. I hope this will be fixed soon. |
I'm having the same issue on react-native when switching the theme with Sometimes it's crashing my app, I'm having 6 warnings of the same message with different components clashing, here for Circle:
|
Hi there, Just more context: It is happening on 1.74.10 as well. When I remove the |
I have the same problem as @osmanyz with the latest version (^1.78.0) Both the
|
Also having this warning : In this view, Im applying the theme dark or light to a It only occurs when change the defined theme like so :
Any news ? |
I'm getting a similar warning with the Tabs component. |
I will get to this soon, but just know nothing is breaking. There's a patch to get rid of it but it slows down your app theme changes a lot, I'd rather fix it right but it's one of the most complex areas in Tamagui so needs a whole day or two of heavy concentration. |
Hi guys, I'm facing the same problem when changing the theme. 🫤 ERROR Warning: Cannot update a component (`ButtonText`) while rendering a different component (`Button`). To locate the bad setState() call inside `Button`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
in Button (created by Page)
in RCTView (created by View)
in View (created by AnimatedComponent(View))
in AnimatedComponent(View)
in Unknown
in Unknown (created by Page)
in Page (created by SceneView)
in StaticContainer
in EnsureSingleNavigator (created by SceneView)
in SceneView (created by SceneView)
in RCTView (created by View)
in View (created by DebugContainer)
in DebugContainer (created by MaybeNestedStack)
in MaybeNestedStack (created by SceneView)
in RCTView (created by View)
in View (created by SceneView)
in RNSScreen
in Unknown (created by InnerScreen)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by InnerScreen)
in InnerScreen (created by Screen)
in Screen (created by SceneView)
in SceneView (created by NativeStackViewInner)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by ScreenStack)
in RNSScreenStack (created by ScreenStack)
in ScreenStack (created by NativeStackViewInner)
in NativeStackViewInner (created by NativeStackView)
in RCTView (created by View)
in View (created by SafeAreaInsetsContext)
in SafeAreaProviderCompat (created by NativeStackView)
in NativeStackView (created by NativeStackNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by NativeStackNavigator)
in NativeStackNavigator (created by AppRoutes)
in AppRoutes (created by Routes)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by Routes)
in Unknown (created by Routes)
in Routes (created by App)
in _QueryClientProvider (created by PreloadWrapper)
in PortalProviderComponent (created by BottomSheetModalProviderWrapper)
in BottomSheetModalProviderWrapper (created by PreloadWrapper)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by PreloadWrapper)
in PreloadWrapper (created by App)
in PortalProviderComponent (created by _TamaguiProvider)
in Unknown (created by _ThemeProvider)
in _ThemeProvider (created by _TamaguiProvider)
in Provider (created by _TamaguiProvider)
in _TamaguiProvider (created by _TamaguiProvider)
in _TamaguiProvider (created by ThemeWrapper)
in ThemeWrapper (created by App)
in RCTView (created by View)
in View (created by GestureHandlerRootView)
in GestureHandlerRootView (created by App)
in App (created by withDevTools(App))
in withDevTools(App)
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in main(RootComponent)
``` |
Encountering the same error/warning with a fresh install of tamagui with
|
@natew Has this issue been fixed yet? I am getting it as well on web when using Select. |
Im having the same issue above when using Select component in ios and web.
|
I am also having this issue, starting with 1.75.7. 1.75.1 seems to work, so for now I will stop my upgrading at that version. |
I am having the same issue with the latest 1.89.8 |
Same issue with LTS 1.89.8
|
I'm getting a similar issue with the Checkbox component: ERROR Warning: Cannot update a component ( |
A short-term fix is just to ignore the log since this is a non-destructive according to @natew.
|
more agressive but:
|
I am having the same issue with the latest 1.91.3 |
Button
) while rendering a different component (Button
). To locate the bad setState() call inside Button
, follow the stack trace as described in https://reactjs.org/link/setstate-in-renderButton
) while rendering a different component (Button
).
Hey Nate good work on everything, I know you've been busy but have you found any time to check this? It is really annoying for developing and debugging as you said. Thanks a lot. |
The same problem and it resolved by upgrading to 1.94.4 |
Hey @daminhtung not for me, I think the real issue is "Warning: Cannot update a component X while rendering a different component X", might be fixed for you for button but in my case is for theme, I though it was a general problem but if it's fixed for button and not for theme might be something different then. |
Changing the theme in 1.94.4 (using expo, native only) >>> I'm getting these warning since I started using tamagui [v1.91.1]
I get more of the warnings at a time, its really annoying 😒 And now I expericenced this: At times it gets stuck in between, and sometimes the text color does not change at all or is some unusual gray. @natew, done a great job, but the issue needs to be fixed at earnest. |
I'm getting a similar issue with the ToggleGroup component(latest version 1.94.5): ERROR Warning: Cannot update a component (`ForwardRef`) while rendering a different component (`Theme`). To locate the bad setState() call inside `Theme`, follow the stack trace as described in https://react.dev/link/setstate-in-render
in Theme (created by Toggle)
in RCTView (created by Toggle)
in Toggle
in Unknown
in Unknown (created by Slot)
in Slot (created by Stack)
in Stack (created by RovingFocusGroupItem)
in RovingFocusGroupItem (created by ToggleGroupItem)
in Provider (created by ToggleGroupItem)
in ToggleGroupItem (at create-room.tsx:106)
in RCTView (created by GroupFrame)
in GroupFrame
in GroupProvider
in Unknown (created by Themed(Anonymous))
in Theme (created by Themed(Anonymous))
in Themed(Anonymous) (created by ToggleGroup)
in ToggleGroup (created by Slot)
in Slot (created by Stack)
in Stack (created by RovingFocusGroup)
in RovingFocusGroup
in Provider
in Unknown
in Provider
in Unknown (created by ToggleGroup)
in ToggleGroup (at create-room.tsx:95)
in RCTView
in Unknown (at create-room.tsx:78)
in RCTScrollContentView (at ScrollView.js:1732)
in RCTScrollView (at ScrollView.js:1855)
in ScrollView (at ScrollView.js:1925)
in ScrollView (created by ScrollView)
in ScrollView (at create-room.tsx:67)
in RCTView (created by Form)
in Form
in FormProvider
in Unknown (at create-room.tsx:65)
in CreateRoom (at useScreens.js:112)
in Unknown (at useScreens.js:116)
in Suspense (at useScreens.js:115)
in Route (at useScreens.js:131)
in Route(club/create-room) (at SceneView.tsx:132)
in StaticContainer
in EnsureSingleNavigator (at SceneView.tsx:124)
in SceneView (at useDescriptors.tsx:218)
in RCTView (at View.js:116)
in View (at DebugContainer.native.tsx:34)
in DebugContainer (at NativeStackView.native.tsx:82)
in MaybeNestedStack (at NativeStackView.native.tsx:325)
in RCTView (at View.js:116)
in View (at NativeStackView.native.tsx:318)
in RNSScreen (at createAnimatedComponent.js:54)
in Unknown (at src/index.native.tsx:314)
in Suspender (at src/index.tsx:27)
in Suspense (at src/index.tsx:26)
in Freeze (at src/index.native.tsx:206)
in DelayedFreeze (at src/index.native.tsx:313)
in InnerScreen (at src/index.native.tsx:566)
in Screen (at NativeStackView.native.tsx:253)
in SceneView (at NativeStackView.native.tsx:413)
in Suspender (at src/index.tsx:27)
in Suspense (at src/index.tsx:26)
in Freeze (at src/index.native.tsx:206)
in DelayedFreeze (at src/index.native.tsx:220)
in RNSScreenStack (at src/index.native.tsx:227)
in ScreenStack (at NativeStackView.native.tsx:401)
in NativeStackViewInner (at NativeStackView.native.tsx:474)
in RCTView (at View.js:116)
in View (at SafeAreaProviderCompat.tsx:43)
in SafeAreaProviderCompat (at NativeStackView.native.tsx:473)
in NativeStackView (at createNativeStackNavigator.tsx:72)
in PreventRemoveProvider (at useNavigationBuilder.tsx:718)
in NavigationContent (at useComponent.tsx:35)
in Unknown (at createNativeStackNavigator.tsx:71)
in NativeStackNavigator (at withLayoutContext.js:65)
in Unknown (at _layout.tsx:52)
in GameProvider (at provider.tsx:18)
in AuthProvider (at provider.tsx:17)
in ToastImperativeProvider (created by ToastProvider)
in Provider (created by ToastProvider)
in Provider (created by CollectionProvider)
in CollectionProvider (created by ToastProvider)
in ToastProvider (at provider.tsx:16)
in RCTView (at View.js:116)
in View (at GestureHandlerRootView.tsx:20)
in GestureHandlerRootView (at provider.tsx:15)
in RNCSafeAreaProvider (at SafeAreaContext.tsx:92)
in SafeAreaProvider (at provider.tsx:14)
in Provider (at _layout.tsx:51)
in Theme (at _layout.tsx:50)
in PortalProviderComponent (created by TamaguiProvider)
in Theme (created by ThemeProvider)
in ThemeProvider (created by TamaguiProvider)
in Provider (created by TamaguiProvider)
in TamaguiProvider (created by TamaguiProvider)
in TamaguiProvider (at _layout.tsx:49)
in ThemeProvider (at _layout.tsx:48)
in RootLayout
in Try (at useScreens.js:73)
in Unknown (at useScreens.js:112)
in Unknown (at useScreens.js:116)
in Suspense (at useScreens.js:115)
in Route (at useScreens.js:131)
in Route() (at ExpoRoot.js:90)
in RNCSafeAreaProvider (at SafeAreaContext.tsx:92)
in SafeAreaProvider (at ExpoRoot.js:55)
in wrapper (at ExpoRoot.js:89)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:433)
in BaseNavigationContainer (at NavigationContainer.native.js:105)
in ThemeProvider (at NavigationContainer.native.js:104)
in NavigationContainerInner (at ExpoRoot.js:86)
in ContextNavigator (at ExpoRoot.js:64)
in ExpoRoot (at qualified-entry.js:20)
in App (created by ErrorOverlay)
in ErrorToastContainer (created by ErrorOverlay)
in ErrorOverlay (at withDevTools.ios.js:29)
in withDevTools(ErrorOverlay) (at renderApplication.js:57)
in RCTView (at View.js:116)
in View (at AppContainer.js:127)
in RCTView (at View.js:116)
in View (at AppContainer.js:155)
in AppContainer (at renderApplication.js:50)
in main(RootComponent) (at renderApplication.js:67)
|
same here for buttons |
Thanks guys I hear you. And sorry it's taking so long. I have my PR here with the refactor to fix it you can subscribe to. I spent a few days on it in January and got a long way there but the long tail of getting the themes system correct + fast on every platform is quite long. In fact it's pretty damn fast now so it's been hard to match even without correctness. I'll resume on it soon. |
Any updates? In my case it crashing iOS app when I navigate between screens in production mode. |
It definitely doesn’t crash, you likely just have a crash at the same time from something else |
🙏 |
You are right. In my case, there is a problem with the fonts. |
Hello guys, same things happening with ToggleGroup here. Should I remove the theme provider before the fix ? Also, thanks to for the future fix @natew, I subscribed to the issue. |
I'm making a note to revisit this soon - we are very close to shipping a big project that has been taking up a lot of time (not to mention Bento), but as soon as that merges we are much more cleared up to move through and cleanup the backlog. |
Keep in mind the LogBox ignore should be good for now to silence these:
|
By the way this issue is actually I believe due to the async bridge. I’ll have to test if the new architecture with sync mode will just fix this for us automatically. |
please fix it |
Similar error happens when using
|
Current Behavior
In ios simulator using takeout.
Can confirm it's tamagui because i haven't updated my project to takeouts latest changes.
Same warning also shows in latest version of takeout as well.
Expected Behavior
No warning.
Tamagui Version
Platform (Web, iOS, Android)
Reproduction
System Info
The text was updated successfully, but these errors were encountered: