conditional return works in browser, but not on an Android phone?

This issue has been tracked since 2022-09-21.

Description

Working on a React Native app in Expo, I am encountering a strange problem: everything is fine in browser preview, but on the phone, the conditional return does not happen.


### Version
0.69.6

### Output of `npx react-native info`

info Fetching system and libraries information...
System:
    OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (4) x64 Intel(R) Core(TM) i5-4300M CPU @ 2.60GHz
    Memory: 3.67 GB / 7.66 GB
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 17.8.0 - ~/.nvm/versions/node/v17.8.0/bin/node
    Yarn: Not Found
    npm: 8.5.5 - ~/.nvm/versions/node/v17.8.0/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 11.0.16 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.5 => 0.69.5 
  npmGlobalPackages:
    *react-native*: Not Found


### Steps to reproduce

1. clone the repository
2. npx expo start
3. open the app on an android phone Expo app
4. click 'next' on the first page (count 0)
5. type in 'August' and click on 'submit' on the second page (count 1)

### Snack, code example, screenshot, or link to a repository

https://github.com/ydrea/rnthegame.git

AGame.js

return (



{search === item.name ? (

) : (

)}


);

ydrea wrote this answer on 2022-09-22

solved it in a roundabout manner...

  //submit query to search
  const handleSubmit = () => {
    searchSet(query);
    //flip the switches
    checkSet(true);
    querySet("");
  };
  //a bit of...
  useEffect(() => {
    //...cleanup for the next one
    checkSet(false);
  }, [count]);
  //
  return (...
<View>
          {!check ? (
            <Text>{count}</Text>
          ) : (
            <View>
              <RCard sculpture={sculpture} />
            </View>
          )}
        </View>
More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-10-03
Star Count 105144
Watcher Count 3666
Fork Count 22469
Issue Count 2232

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date