React Native cannot find children when true is available

Using this JSX:

<View>
  <Text testID='t1'>text 1</Text>
  <Text testID='t2'>text 2</Text>
</View>

I can find children by theirs testID(e.g. with Appium)

If I change Viewto a TouchableOpacity, then the children seem to come together in one UIAElementon iOS and then cannot be found.

It seems to TouchableOpacityhave the hardcoded property available to true, and this allows the crash behavior (see https://code.facebook.com/posts/435862739941212/making-react-native-apps-accessible/ )

Is this the expected behavior? This makes testing difficult.

+4
source share
1 answer

, , = {true}. , , :

<View accessible={false}>
  <Text testID='t1'>text 1</Text>
  <Text testID='t2'>text 2</Text>
</View>

, ( ).

+4

Source: https://habr.com/ru/post/1627946/


All Articles