title: React Native TypeError: undefined is not an object (evaluating 'props.getItem')
body: <p>When navigating to certain screens on my React Native app (using expo), I am getting the following error:</p>
  <pre><code>TypeError: undefined is not an object (evaluating 'props.getItem')
  </code></pre>
  <p>It has been working fine previously, and from doing research it appears to be a problem with my packages/babel, but I have tried several solutions, including</p>
  <pre><code>npm upgrade --latest
  </code></pre>
  <p>And resetting the cache, but had no luck so far.</p>
  <p>This is the contents of my package.json:</p>
  <pre><code>{
    &quot;main&quot;: &quot;node_modules/expo/AppEntry.js&quot;,
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;expo start&quot;,
      &quot;android&quot;: &quot;expo start --android&quot;,
      &quot;ios&quot;: &quot;expo start --ios&quot;,
      &quot;web&quot;: &quot;expo start --web&quot;,
      &quot;eject&quot;: &quot;expo eject&quot;,
      &quot;test&quot;: &quot;jest&quot;,
      &quot;test:watch&quot;: &quot;npm test -- --watch&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@react-native-async-storage/async-storage&quot;: &quot;^1.15.7&quot;,
      &quot;@react-native-community/masked-view&quot;: &quot;0.1.10&quot;,
      &quot;@react-native-picker/picker&quot;: &quot;1.16.1&quot;,
      &quot;@react-navigation/bottom-tabs&quot;: &quot;^5.11.15&quot;,
      &quot;@react-navigation/drawer&quot;: &quot;^5.12.9&quot;,
      &quot;@react-navigation/material-top-tabs&quot;: &quot;^5.3.19&quot;,
      &quot;@react-navigation/native&quot;: &quot;^5.9.8&quot;,
      &quot;@react-navigation/stack&quot;: &quot;^5.14.9&quot;,
      &quot;expo&quot;: &quot;^42.0.3&quot;,
      &quot;expo-app-loading&quot;: &quot;^1.1.2&quot;,
      &quot;expo-font&quot;: &quot;~9.2.1&quot;,
      &quot;expo-status-bar&quot;: &quot;~1.0.4&quot;,
      &quot;jwt-decode&quot;: &quot;^3.1.2&quot;,
      &quot;react&quot;: &quot;16.13.1&quot;,
      &quot;react-dom&quot;: &quot;16.13.1&quot;,
      &quot;react-native&quot;: &quot;https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz&quot;,
      &quot;react-native-currency-input&quot;: &quot;^1.0.1&quot;,
      &quot;react-native-gesture-handler&quot;: &quot;~1.10.2&quot;,
      &quot;react-native-qrcode-svg&quot;: &quot;^6.1.1&quot;,
      &quot;react-native-reanimated&quot;: &quot;^2.2.1&quot;,
      &quot;react-native-responsive-screen&quot;: &quot;^1.4.2&quot;,
      &quot;react-native-safe-area-context&quot;: &quot;3.2.0&quot;,
      &quot;react-native-screens&quot;: &quot;~3.4.0&quot;,
      &quot;react-native-svg&quot;: &quot;^12.1.1&quot;,
      &quot;react-native-tab-view&quot;: &quot;^2.16.0&quot;,
      &quot;react-native-toast-message&quot;: &quot;^1.6.0&quot;,
      &quot;react-native-web&quot;: &quot;^0.17.1&quot;,
      &quot;react-redux&quot;: &quot;^7.2.5&quot;,
      &quot;redux&quot;: &quot;^4.1.1&quot;,
      &quot;redux-thunk&quot;: &quot;^2.3.0&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/plugin-proposal-private-methods&quot;: &quot;^7.14.5&quot;,
      &quot;@types/jest&quot;: &quot;^27.0.1&quot;,
      &quot;@types/react&quot;: &quot;~16.9.35&quot;,
      &quot;@types/react-native&quot;: &quot;^0.63.53&quot;,
      &quot;@types/react-test-renderer&quot;: &quot;^17.0.1&quot;,
      &quot;babel-jest&quot;: &quot;^27.2.0&quot;,
      &quot;jest-expo&quot;: &quot;^42.1.0&quot;,
      &quot;react-test-renderer&quot;: &quot;^17.0.2&quot;,
      &quot;redux-mock-store&quot;: &quot;^1.5.4&quot;,
      &quot;typescript&quot;: &quot;~4.0.0&quot;
    },
    &quot;private&quot;: true,
    &quot;jest&quot;: {
      &quot;preset&quot;: &quot;jest-expo&quot;
    }
  }
  </code></pre>
  <p>And this is my babel.config.js:</p>
  <pre><code>module.exports = {
      presets: ['module:metro-react-native-babel-preset'],
      plugins: [
        [&quot;@babel/plugin-proposal-private-methods&quot;, { &quot;loose&quot;: true }],
        'react-native-reanimated/plugin'
      ],
    };
  </code></pre>
  <p>And the full stack trace is this:</p>
  <pre><code>TypeError: undefined is not an object (evaluating 'props.getItem')
  
  This error is located at:
      in FlatList (at Modal.tsx:65)
      in RCTView (at View.js:34)
      in View (at Modal.tsx:64)
      in RCTView (at View.js:34)
      in View (at Modal.tsx:57)
      in MenuModal (at SceneView.tsx:130)
      in StaticContainer
      in StaticContainer (at SceneView.tsx:123)
      in EnsureSingleNavigator (at SceneView.tsx:122)
      in SceneView (at useDescriptors.tsx:181)
      in RCTView (at View.js:34)
      in View (at CardContainer.tsx:245)
      in RCTView (at View.js:34)
      in View (at CardContainer.tsx:244)
      in RCTView (at View.js:34)
      in View (at CardSheet.tsx:33)
      in ForwardRef(CardSheet) (at Card.tsx:573)
      in RCTView (at View.js:34)
      in View (at createAnimatedComponent.js:165)
      in AnimatedComponent (at createAnimatedComponent.js:215)
      in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
      in PanGestureHandler (at GestureHandlerNative.tsx:13)
      in PanGestureHandler (at Card.tsx:549)
      in RCTView (at View.js:34)
      in View (at createAnimatedComponent.js:165)
      in AnimatedComponent (at createAnimatedComponent.js:215)
      in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
      in RCTView (at View.js:34)
      in View (at Card.tsx:538)
      in Card (at CardContainer.tsx:206)
      in CardContainer (at CardStack.tsx:623)
      in RNSScreen (at createAnimatedComponent.js:165)
      in AnimatedComponent (at createAnimatedComponent.js:215)
      in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
      in Screen (at Screens.tsx:74)
      in MaybeScreen (at CardStack.tsx:616)
      in RNSScreenContainer (at src/index.native.tsx:186)
      in ScreenContainer (at Screens.tsx:50)
      in MaybeScreenContainer (at CardStack.tsx:498)
      in CardStack (at StackView.tsx:462)
      in KeyboardManager (at StackView.tsx:458)
      in SafeAreaProviderCompat (at StackView.tsx:455)
      in RCTView (at View.js:34)
      in View (at GestureHandlerRootView.android.tsx:21)
      in GestureHandlerRootView (at StackView.tsx:454)
      in StackView (at createStackNavigator.tsx:87)
      in StackNavigator (at Root.tsx:12)
      in RootStack (at SceneView.tsx:130)
      in StaticContainer
      in StaticContainer (at SceneView.tsx:123)
      in EnsureSingleNavigator (at SceneView.tsx:122)
      in SceneView (at useDescriptors.tsx:181)
      in RCTView (at View.js:34)
      in View (at CardContainer.tsx:245)
      in RCTView (at View.js:34)
      in View (at CardContainer.tsx:244)
      in RCTView (at View.js:34)
      in View (at CardSheet.tsx:33)
      in ForwardRef(CardSheet) (at Card.tsx:573)
      in RCTView (at View.js:34)
      in View (at createAnimatedComponent.js:165)
      in AnimatedComponent (at createAnimatedComponent.js:215)
      in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:555)
      in PanGestureHandler (at GestureHandlerNative.tsx:13)
      in PanGestureHandler (at Card.tsx:549)
      in RCTView (at View.js:34)
      in View (at createAnimatedComponent.js:165)
      in AnimatedComponent (at createAnimatedComponent.js:215)
      in ForwardRef(AnimatedComponentWrapper) (at Card.tsx:544)
      in RCTView (at View.js:34)
      in View (at Card.tsx:538)
      in Card (at CardContainer.tsx:206)
      in CardContainer (at CardStack.tsx:623)
      in RNSScreen (at createAnimatedComponent.js:165)
      in AnimatedComponent (at createAnimatedComponent.js:215)
      in ForwardRef(AnimatedComponentWrapper) (at src/index.native.tsx:147)
      in Screen (at Screens.tsx:74)
      in MaybeScreen (at CardStack.tsx:616)
      in RNSScreenContainer (at src/index.native.tsx:186)
      in ScreenContainer (at Screens.tsx:50)
      in MaybeScreenContainer (at CardStack.tsx:498)
      in CardStack (at StackView.tsx:462)
      in KeyboardManager (at StackView.tsx:458)
      in RNCSafeAreaProvider (at SafeAreaContext.tsx:76)
      in SafeAreaProvider (at SafeAreaProviderCompat.tsx:42)
      in SafeAreaProviderCompat (at StackView.tsx:455)
      in GestureHandlerRootView (at GestureHandlerRootView.android.tsx:26)
      in GestureHandlerRootView (at StackView.tsx:454)
      in StackView (at createStackNavigator.tsx:87)
      in StackNavigator (at MainNavigator.tsx:60)
      in EnsureSingleNavigator (at BaseNavigationContainer.tsx:411)
      in ForwardRef(BaseNavigationContainer) (at NavigationContainer.tsx:91)
      in ThemeProvider (at NavigationContainer.tsx:90)
      in ForwardRef(NavigationContainer) (at MainNavigator.tsx:59)
      in MainNavigator (at App.tsx:64)
      in Provider (at App.tsx:57)
      in App (created by ExpoRoot)
      in ExpoRoot (at renderApplication.js:45)
      in RCTView (at View.js:34)
      in View (at AppContainer.js:106)
      in RCTView (at View.js:34)
      in View (at AppContainer.js:132)
      in AppContainer (at renderApplication.js:39)
  at node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError
  at node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl
  at node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error
  at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
  at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
  at node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleException
  at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
  at node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
  at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
  at node_modules\regenerator-runtime\runtime.js:293:29 in invoke
  at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
  at node_modules\regenerator-runtime\runtime.js:154:27 in invoke
  at node_modules\regenerator-runtime\runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
  at node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
  at node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
  at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
  at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass
  at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
  at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates
  at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0
  at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
  at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
  </code></pre>
  <p>In case it is relevant, here is the modal component where the error seems to be coming from:</p>
  <pre><code>const BUTTONS = [
      {
          id: &quot;1&quot;,
          title: &quot;Button1&quot;,
          icon: &quot;button1-icon&quot;,
      },
      {
          id: &quot;2&quot;,
          title: &quot;Button2&quot;,
          icon: &quot;button2-icon&quot;,
      },        
  ];
  
  const Modal = ({ navigation }: any) =&gt; {
      const renderButton = ({ item }: any) =&gt; (
          &lt;GridTile
              title={item.title}
              colour={colours.accent}
              icon={item.icon}
              onSelect={() =&gt; navigation.navigate(item.title)}
          /&gt;
      );
  
      return (
          &lt;View&gt;                
              &lt;View&gt;
                  &lt;FlatList
                      data={BUTTONS}
                      renderItem={renderButton}                        
                      numColumns={2}
                  /&gt;
              &lt;/View&gt;
          &lt;/View&gt;
      );
  };    
  
  
  export default Modal;
  </code></pre>