react-native
react-native copied to clipboard
Android App crashes when we assign "Object" to disabled property in TouchableOpacity (React Native Version 0.70+).
Summary
Android App crashes when we assign "Object" to disabled property in TouchableOpacity (React Native Version 0.70+).
For Example: <TouchableOpacity onPress={onPress} disabled={ {} } //it will show error disabled={ {} ? false : true } //it won't show error /> Error : Value for disabled cannot be cast from ReadableNativeMap to Boolean https://github.com/facebook/react-native/issues/35119#issue-1427134346
Changelog
Added double negation. const accessibilityState = this.props.disabled != null ? { ..._accessibilityState, disabled: this.props.disabled, disabled: !!this.props.disabled, } : _accessibilityState;
[Android] [Fixed] - Android bug fixed - Now Android App will not crash on passing "Object" to disabled property in TouchableOpacity (React Native Version 0.70+).
Test Plan
Now Android App will not crash on passing "Object" to disabled property in TouchableOpacity (React Native Version 0.70+).
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 7,003,370 | +16 |
| android | hermes | armeabi-v7a | 6,379,710 | +19 |
| android | hermes | x86 | 7,416,208 | +23 |
| android | hermes | x86_64 | 7,280,113 | +22 |
| android | jsc | arm64-v8a | 8,868,338 | +8 |
| android | jsc | armeabi-v7a | 7,606,656 | +12 |
| android | jsc | x86 | 8,926,232 | +2 |
| android | jsc | x86_64 | 9,409,469 | +2 |
Base commit: d0f94e6c2d9f91ac8ffab5218ed95cac63df09e5 Branch: main
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| ios | - | universal | n/a | -- |
Base commit: d0f94e6c2d9f91ac8ffab5218ed95cac63df09e5 Branch: main
PR build artifact for 17e4cc1458317e31d165aa7751edc3c8aeec4bd3 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.
PR build artifact for 17e4cc1458317e31d165aa7751edc3c8aeec4bd3 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.
How long it will take to merge this PR ?
@sshic has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@MirUmair Can you fix the circleci test failure?
@MirUmair Can you fix the circleci test failure? @sshic i don't know how to fix this test , i tried but failed .
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity.