You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Id prop is replacing NativeID prop, but the PR #34522 that added these changes includes only TouchableWithoutFeedback.
Other Touchables like TouchableOpacity, TouchableHighlight etc all inherit from TouchableWithoutFeedback props, they should support Id prop too, but this is not present currently.
React Native Version
0.72.0
Output of npx react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.22621
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory: 11.98 GB / 31.71 GB
Binaries:
Node:
version: 18.5.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.19
path: ~\AppData\Roaming\npm\yarn.CMD
npm:
version: 8.12.1
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.19041.0
IDEs:
Android Studio: AI-212.5712.43.2112.8609683
Visual Studio:
- 16.11.33801.447 (Visual Studio Community 2019)
Languages:
Java: 11.0.15
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.0
wanted: 0.72.0
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Steps to reproduce
Set Id prop on a touchableOpacity and try to access it using ReactFindViewUtil.findView(parentView, viewId). This fails.
Snack, code example, screenshot, or link to a repository
TSX -
<View>
<TouchableOpacity
onPress={onPress}
id={id}
accessibilityRole="button">
<Text>Click to invoke your native module!</Text>
</TouchableOpacity>
</View>
Description
Id prop is replacing NativeID prop, but the PR #34522 that added these changes includes only TouchableWithoutFeedback.
Other Touchables like TouchableOpacity, TouchableHighlight etc all inherit from TouchableWithoutFeedback props, they should support Id prop too, but this is not present currently.
React Native Version
0.72.0
Output of
npx react-native info
info Fetching system and libraries information...
System:
OS: Windows 10 10.0.22621
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
Memory: 11.98 GB / 31.71 GB
Binaries:
Node:
version: 18.5.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.19
path: ~\AppData\Roaming\npm\yarn.CMD
npm:
version: 8.12.1
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.19041.0
IDEs:
Android Studio: AI-212.5712.43.2112.8609683
Visual Studio:
- 16.11.33801.447 (Visual Studio Community 2019)
Languages:
Java: 11.0.15
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.0
wanted: 0.72.0
react-native-windows: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Steps to reproduce
Set Id prop on a touchableOpacity and try to access it using ReactFindViewUtil.findView(parentView, viewId). This fails.
Snack, code example, screenshot, or link to a repository
TSX -
Android Native Module -
Verify Null is not returned.
Same code works while nativeID is set. But typescript complains that nativeID is not a supported prop.
The text was updated successfully, but these errors were encountered: