diff --git a/Libraries/Components/View/View.js b/Libraries/Components/View/View.js index 0379a7ce912f..7822e8184f21 100644 --- a/Libraries/Components/View/View.js +++ b/Libraries/Components/View/View.js @@ -26,13 +26,19 @@ export type Props = ViewProps; const View: React.AbstractComponent< ViewProps, React.ElementRef, -> = React.forwardRef((props: ViewProps, forwardedRef) => { - return ( - - - - ); -}); +> = React.forwardRef( + ({tabIndex, focusable, ...otherProps}: ViewProps, forwardedRef) => { + return ( + + + + ); + }, +); View.displayName = 'View'; diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index 24c0afcaee8a..effed17622cf 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -352,6 +352,19 @@ type AndroidViewProps = $ReadOnly<{| */ focusable?: boolean, + /** + * Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard. + * See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex + * for more details. + * + * Supports the following values: + * - 0 (View is focusable) + * - -1 (View is not focusable) + * + * @platform android + */ + tabIndex?: 0 | -1, + /** * The action to perform when this `View` is clicked on by a non-touch click, eg. enter key on a hardware keyboard. *