This PR removes outer View from Pressable which was previously used for applying props, which were otherwise unavailable on NativeButton.
All such props have been either manually implemented, or have turned out to be available to use directly in NativeButton, so the outer View can be safely removed.
closes #3085
Test plan
paste the provided code in place of the EmptyExample
open the EmptyExample
see how both the boxes on the left, and the ones on the right behave identically
Verifying accessibility
platform specific setup
[iOS] Turn on smart inverted colors mode
[Android] Turn on talkback
paste the provided code in place of the EmptyExample
open the EmptyExample
platform specific steps
[iOS] See how the Nested box model styling section has regular colors
[Android] Press the Nested box model styling and hear how it says Accessibility is working
note:
Most accessibility styles are not implemented on web, but you can verify that accessibility is working on web by inspecting the Pressable and looking for role="button" prop in the HTML, it is an accessibility prop that i found to be working on web.
Description
This PR removes outer
View
fromPressable
which was previously used for applying props, which were otherwise unavailable onNativeButton
.All such props have been either manually implemented, or have turned out to be available to use directly in
NativeButton
, so the outerView
can be safely removed.closes #3085
Test plan
EmptyExample
EmptyExample
Verifying accessibility
[iOS]
Turn onsmart inverted colors mode
[Android]
Turn ontalkback
EmptyExample
EmptyExample
[iOS]
See how theNested box model styling
section has regular colors[Android]
Press theNested box model styling
and hear how it saysAccessibility is working
note: Most accessibility styles are not implemented on
web
, but you can verify that accessibility is working on web by inspecting thePressable
and looking forrole="button"
prop in the HTML, it is an accessibility prop that i found to be working on web.Code
Collapsed code
```tsx import React from 'react'; import { StyleSheet, Text, View, Pressable as RNPressable } from 'react-native'; import { Pressable as GHPressable, PressableProps, } from 'react-native-gesture-handler'; function Pressables(props: PressableProps) { const onPressInGH = () => console.log('GH press'); const onPressInRN = () => console.log('RN press'); return (