react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Bug] View not removed on return null in Observer after upgrading RN 0.82.1 → 0.83.0

Open neegqi opened this issue 1 month ago • 1 comments

Description

On React Native 0.82.1, returning null from a MobX <Observer> render would remove the previously rendered view. After upgrading to React Native 0.83.0 (React 19.2) the view does not get removed as expected: <Observer> {() => { switch (this.status) { case 'loading': return ( <ActivityIndicator style={{ width: 49, height: 49 }} size="small" color={colors.grey} /> ); case 'processing': return ( <InputBarButton iconName="stop-circle-outline" size={25} color={colors.notification} onPress={this.stopAnswering} /> ); } return null; }} </Observer>

Steps to reproduce

1.	Create a minimal RN app with 0.82.1
2.	Render a conditional UI via MobX <Observer> that returns an element or null
3.	Change state to cause render to return null
4.	UI is correctly removed on 0.82.1
5.	Upgrade to RN 0.83.0
6.	Repeat steps: view is not removed when render returns null

import { Observer } from "mobx-react-lite"; import { ActivityIndicator, View } from "react-native";

class Store { status = "idle"; // or 'loading' / 'processing' }

const store = new Store();

// In component: <Observer> {() => { switch (store.status) { case "loading": return <ActivityIndicator />; case "processing": return <SomeButton />; } return null; }} </Observer>

React Native Version

react-native: 0.83.0 react: 19.2.0 mobx:6.15.0 mobx-react-lite: 4.1.1

Affected Platforms

Runtime - iOS, Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.6.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 256.20 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 25.1.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.yarn/bin/yarn
  npm:
    version: 11.6.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2025.04.07.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2512.13930704
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 19.0.1
    path: /usr/bin/javac
  Ruby:
    version: 3.4.2
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.2.0
    wanted: 19.2.0
  react-native:
    installed: 0.83.0
    wanted: 0.83.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

--

MANDATORY Reproducer

--

Screenshots and Videos

No response

neegqi avatar Dec 19 '25 05:12 neegqi

[!WARNING] Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


You can read more about about it on our website: How to report a bug.

react-native-bot avatar Dec 19 '25 05:12 react-native-bot