diff --git a/src/pages/home/sidebar/GlobalNavigation/GlobalNavigationMenuItem.js b/src/pages/home/sidebar/GlobalNavigation/GlobalNavigationMenuItem.js index f0eb381de2df..d24960e80ff2 100644 --- a/src/pages/home/sidebar/GlobalNavigation/GlobalNavigationMenuItem.js +++ b/src/pages/home/sidebar/GlobalNavigation/GlobalNavigationMenuItem.js @@ -8,7 +8,6 @@ import Icon from '../../../../components/Icon'; import CONST from '../../../../CONST'; import variables from '../../../../styles/variables'; import PressableWithFeedback from '../../../../components/Pressable/PressableWithFeedback'; -import refPropTypes from '../../../../components/refPropTypes'; const propTypes = { /** Icon to display */ @@ -20,9 +19,6 @@ const propTypes = { /** Function to fire when component is pressed */ onPress: PropTypes.func, - /** A ref to forward to PressableWithFeedback */ - forwardedRef: refPropTypes, - /** Whether item is focused or active */ isFocused: PropTypes.bool, }; @@ -32,46 +28,37 @@ const defaultProps = { isFocused: false, onPress: () => {}, title: '', - forwardedRef: null, }; -function GlobalNavigationMenuItem({icon, title, isFocused, onPress, forwardedRef}) { - return ( - !isFocused && onPress()} - style={styles.globalNavigationItemContainer} - ref={forwardedRef} - accessibilityRole={CONST.ACCESSIBILITY_ROLE.MENUITEM} - accessibilityLabel={title} - > - {({pressed}) => ( - - - - - - {title} - +const GlobalNavigationMenuItem = React.forwardRef(({icon, title, isFocused, onPress}, ref) => ( + !isFocused && onPress()} + style={styles.globalNavigationItemContainer} + ref={ref} + accessibilityRole={CONST.ACCESSIBILITY_ROLE.MENUITEM} + accessibilityLabel={title} + > + {({pressed}) => ( + + + + + + {title} - )} - - ); -} + + )} + +)); GlobalNavigationMenuItem.propTypes = propTypes; GlobalNavigationMenuItem.defaultProps = defaultProps; GlobalNavigationMenuItem.displayName = 'GlobalNavigationMenuItem'; -export default React.forwardRef((props, ref) => ( - -)); +export default GlobalNavigationMenuItem;