diff --git a/packages/bottom-tabs/src/navigators/createBottomTabNavigator.js b/packages/bottom-tabs/src/navigators/createBottomTabNavigator.js index 934cd8bfc27787..adf180faa03929 100644 --- a/packages/bottom-tabs/src/navigators/createBottomTabNavigator.js +++ b/packages/bottom-tabs/src/navigators/createBottomTabNavigator.js @@ -27,6 +27,8 @@ type State = { class TabNavigationView extends React.PureComponent { static defaultProps = { lazy: true, + getAccessibilityRole: () => 'button', + getAccessibilityStates: ({ focused }) => (focused ? ['selected'] : []), }; static getDerivedStateFromProps(nextProps, prevState) { diff --git a/packages/bottom-tabs/src/views/BottomTabBar.js b/packages/bottom-tabs/src/views/BottomTabBar.js index 08b579f29ea8b3..c8a94c426bfc91 100644 --- a/packages/bottom-tabs/src/views/BottomTabBar.js +++ b/packages/bottom-tabs/src/views/BottomTabBar.js @@ -356,18 +356,13 @@ class TabBarBottom extends React.Component { route, }); - const accessibilityRole = - this.props.getAccessibilityRole({ - route, - }) || 'button'; - - let accessibilityStates = this.props.getAccessibilityStates({ + const accessibilityRole = this.props.getAccessibilityRole({ route, }); - if (!accessibilityStates) { - accessibilityStates = focused ? ['selected'] : []; - } + const accessibilityStates = this.props.getAccessibilityStates( + scene + ); const testID = this.props.getTestID({ route });