React Native action sheet losing access to class variable

This issue has been created since 2022-11-16.

Description

Its a very mysterious problem to me and makes me think theres some sort of compile stack issue.

In a nested ios action sheet I am losing access to a class variable of mine - and "losing access" means that in the first action sheet it is defined and in the second one it is undefined while the component never actually detects the variable changing state to undefined. At the same time I have a global function that takes a parameter that is named the same thing as the said class variable.

The way I am able to get it fixed is to name the function variable and the class variable a different name.

Here is a sample code snippet to show roughly whats going on -

const function = (variableName: string) => {
// Do something with variableName
}

const Component: React.FC = ({ prop1 }) => {
const {
variableName
} = prop1
}

Within the component we are using @expo/react-native-action-sheet with showActionSheetWithOptions and from one of the sheets buttons we open a second showActionSheetWithOptions. In the second action sheet is where variableName is undefined where as in the first one it had a value.

I was able to fix it by changing the function variable name to something other than variableName. This doesn't make much sense to me at all and we don't really know the "why" behind this fix.

Version

0.67.1

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 12.3.1
CPU: (8) x64 Apple M1
Memory: 22.63 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.14.0 - ~/.nvm/versions/node/v15.14.0/bin/node
Yarn: 1.22.10 - /opt/homebrew/bin/yarn
npm: 7.7.6 - ~/.nvm/versions/node/v15.14.0/bin/npm
Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8139111
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.1 => 0.67.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Build app archive and distribute through app store
  2. Land on page that react component is on (added logging so we know values of variable)
  3. Find that variable is defined and then undefined

Note that this always works locally when building app in dev environment on a simulator with Xcode.

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

const function = (variableName: string) => {
// Do something with variableName
}

const Component: React.FC = ({ prop1 }) => {
const {
variableName
} = prop1
}

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-12-10
Star Count 106395
Watcher Count 3660
Fork Count 22685
Issue Count 2288

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
Allow named exports. 3 2019-03-23 2022-11-18
Best practice to handle expired refresh tokens? 8 2022-09-16 2022-11-27
Packages and imports 0 2020-03-07 2022-11-22
Screenshots are outdated 2 2022-07-07 2022-10-27
Publication field: actionable persistent identifiers 27 2022-04-21 2022-11-02
"Server low mem" when playing AAC stream using S/PDIF. 4 2021-12-06 2022-11-29
"invalid HTTP method" while trying to read websocket message 9 2022-10-13 2022-12-01
Upgrading to ethers 5.7.0 breaks tsc with typechain typings 0 2022-08-31 2022-10-27
reason: 'Contract with a Signer cannot override from', 0 2022-09-02 2022-10-27
Add Sepolia to InfuraProvider 1 2022-09-02 2022-10-27
Hi @ricmoo, when we want to call a method with different account we uses .connect() for it, so what is the need of .attach()?? 2 2022-09-02 2022-10-27
Optimism Goerli Infura support 1 2022-09-01 2022-10-27
Meaningless error for "user denied message signature" 0 2022-08-30 2022-10-27
Auto initialize input and output fields 1 2022-07-31 2022-11-29
RUSTSEC-2021-0127: serde_cbor is unmaintained 3 2021-12-01 2022-11-02
为什么在files-added或者fileadded做file的验证的时候,不符合我的验证规则的情况还能把<uploader-list>展示出来 2 2021-05-28 2022-12-01
vite's "open in editor" creates a new file instead of jumping to the correct pos in the existing file 4 2022-05-15 2022-11-02
ImageSVG error undefined is not an object (evaluating 'ReactCurrentActQueue$1.isBatchingLegacy') 1 2022-11-18 2022-12-09
Adding margin totally breaks the page 1 2021-01-15 2022-11-23
[Bug]: Link and tags autocomplete list not fully visible 2 2021-11-27 2022-11-02
Module Keras/tensorflow_probability not found when importing Parametric UMAP 1 2021-12-14 2022-11-22
Em Linux o programa não pode somente olhar para a variavel PATH qd corre um script 0 2022-06-10 2022-11-08
Print jobs fail due to filter error (ghostscript crash) 0 2022-11-02 2022-11-06
Stencil table is completely missing 1 2022-07-29 2022-11-11
[BUG]Fail to read_json with commas replaced by newlines 1 2022-11-30 2022-12-06
Replace diff with epsilon test 0 2022-10-21 2022-11-12
Array bounds error in slsqp_module for unconstrained optimization problem, i.e. m = meq = 0 1 2021-05-07 2022-11-12
problems with set CFG_CORE_DYN_SHM=y 2 2022-11-02 2022-12-03
有没有想过Spring Boot+Feign Plus+Agent实现Servie Mesh? 0 2022-10-17 2022-11-15
@FeignPlusClient注解类上的URL你是怎么做到动态获取到值的呢? 1 2021-08-04 2022-11-15
Issue with Cmake on Apple Silicone 2 2022-05-18 2022-12-01
Leaking textures with CDD 6 2021-09-13 2022-11-09
160x143 box art will fail to reload on the first entry in the file list after unloading 1 2021-07-25 2022-11-17
Feature: Support `INSERT INTO ... JSONEachRow` statement 1 2022-03-22 2022-11-29
`NullPointerException` in `IonParser.nextToken()` 4 2021-11-01 2022-12-06
Can't get symbol information on certain invocation expressions 0 2022-06-27 2022-11-29
`toB58String()` function missing when activating debugging with libp2p 5 2022-04-14 2022-11-27
Issue initiating gpt2 tokenizer 0 2022-09-26 2022-11-29
Issue initiating gpt2 tokenizer 0 2022-09-26 2022-11-29
Add table of contents 0 2021-03-23 2022-11-03
Rapid Application Publish - Permissions error 11 2022-09-20 2022-11-29
prometheus server failed to run when helm upgrade using official prometheus chart 0 2022-10-18 2022-11-15
[Question]: Can playwright prevent buttons/links (like '_blank') from opening a new window. Keep the current page jump. 1 2021-07-08 2022-11-25
F-Droid updates stuck 2 2020-12-12 2022-11-15
npm install error because of certificate 1 2021-06-22 2022-11-29
Bump s3 from 2.17.15 to 2.17.25 in /buildSrc/src/main/resources 1 2021-08-23 2022-11-15
Left arm detects external fault pressed even if it is not - iCubGenova04 1 2021-09-20 2022-11-02
Question: postMessage API - App -> inAppBrowser Window 4 2021-12-21 2022-12-02
Allow a pointer to be removed using GraphQL 0 2021-08-23 2022-11-02
`customOptions` is not typed, so TypeScript is giving errors 2 2021-11-29 2022-11-27