New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TouchableOpacity] [0.12.X, canary] changing disabled prop crashes in test environments #1584
Comments
Please try version |
That release works perfectly in the CodeSandbox minimal example (hooray)! Will apply it to our apps tomorrow and let you know how it fares...thanks a bunch @necolas. |
@necolas btw, the canary appear as "latest" on npm https://www.npmjs.com/package/react-native-web (see version tab), you should maybe adjust the tags |
🤦♂️ |
@necolas just confirmed that this is working perfectly on the latest canary release! two quick questions:
|
and, most importantly - thank you |
Yeah let's leave it open until it's fixed on master. And yes please a new comment about the ScrollView issue would be great |
done and done! thanks again. |
The problem
Hi there! Thanks so much for all the hard work in maintaining this library. I'm trying to upgrade RNW to 0.12.2 (or beyond), and am facing an issue specific to
TouchableOpacity
s in Jest tests. Basically, in a test, if a Touchable'sdisabled
property is changed, the subsequent render blows up when trying to apply the relevant styles:I dug into the stacktrace, and I think I have identified a potential culprit. In
NativeMethodsMixin.js
, there is asetNativeProps
function which callsfindNodeHandle(this)
. The result of that call (in tests) appears to be a ref, and thus doesn't have aclassList
property whennode.classList
is used bygetDOMStyleInfo
:To be clear, everything is A-ok outside of tests (in the browser, everything is fine, and
node
is an actual node). Happy to hop in and try to fix and file a PR - but could use some guidance as to what the actual issue is!How to reproduce
Simplified test case: https://codesandbox.io/s/nameless-water-o6qzg?file=/src/App.test.js
Steps to reproduce:
TypeError: Cannot convert undefined or null to object
.Expected behavior
No
TypeError
.Environment (include versions). Did this work in previous versions?
Yep! This test works against 0.11.7 (tested in CodeSandbox), but not on 0.12.X or the canary builds 0.0.0.X.
The text was updated successfully, but these errors were encountered: