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
{{ message }}
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
onLayout is a prop supported by TouchableOpacity so it'd be good to be able to verify that my component called it's onLayout handler that I pass to it when a layout event is triggered.
The text was updated successfully, but these errors were encountered:
I've also noticed that when inspecting the view objects in both examples that the View based object has it's type and elementType properties set to View whereas the TouchableOpacity has both properties set to ''.
Not sure if that will help figure out what's happening or not
react-native
orexpo
: Exponative-testing-library
version: 5.0.3jest-preset
:@testing-library/react-native
react-native
version: Expo 38 / RN 0.62node
version: 14Relevant code or config:
What you did:
Tried to test the
onLayout
functionality of a component that uses TouchableOpacity.What happened:
Mocked onLayout handler was never called.
I had followed https://stackoverflow.com/questions/57961440/testing-onlayout-in-react-native/61774123#61774123 which suggested that it should work and on testing a
View
based component like in the example it worked, however on changing theView
toTouchableOpacity
it no longer worked.Reproduction:
See attached test cases.
Problem description:
onLayout
is a prop supported byTouchableOpacity
so it'd be good to be able to verify that my component called it'sonLayout
handler that I pass to it when a layout event is triggered.The text was updated successfully, but these errors were encountered: