How to fix '_react["default"].memo is not a function. (In '_react["default"].memo(connectFunction)' error in React native? : <p>I am trying to connect Redux mapStateToProps() and mapActionCreators() to Login Screen through Container and I am using React navigation.</p>

<p>After build my app the following error message appears:</p>

<blockquote>
  <p>_react["default"].memo is not a function. (In '_react["defaults"].memo(connectFunction)', '_react["defaults"].memo' is undefined.</p>
</blockquote>

<p>I searched for a while but what I have gotten is that React.memo() helps us control when our components rerender but I don't use any code related to React.memo().</p>

<p>Login Screen: (screens/LoginScreen/index.js)</p>

<pre><code>import React from 'react';
import {Dimensions, View} from 'react-native';

//Get width of mobile screen
var width = Dimensions.get("window").width;
var height = Dimensions.get("window").height;

export default class LoginScreen extends React.Component {
    constructor(props){
        super(props);
        this.state = {

        }
    }

    render() {
        return (
            &lt;View style={styles.container}&gt;
                &lt;Text&gt;Log In page&lt;/Text&gt;
            &lt;/View&gt;
        );
    }
}

LoginScreen.defaultProps = {
}

const styles = {
    container: {
        flex: 1
    }
}
</code></pre>

<p>Login screen container: (containers/LoginContainer/index.js)</p>

<pre><code>import {connect} from "react-redux";
import LoginScreen from "../../screens/LoginScreen";

const mapStateToProps = (state) =&gt;({

});


const mapActionCreators = {

};
export default connect(mapStateToProps, mapActionCreators)(LoginScreen);
</code></pre>

<p>Top level navigation: (navigations/TopLevelSwitchNav.js)</p>

<pre><code>import {createSwitchNavigation, createAppContainer} from 'react-navigation';
import LoginScreen from '../containers/LoginContainer';
import MainTabNav from './MainTabNav';


const TopLevelSwitchNav = createSwitchNavigation({
    Login:  {
        screen: LoginScreen,
        navigationOptions: {
            header: null
        }
    },
    MainTab: {
        screen: MainTabNav,
        navigationOptions: {
            header: null
        }
    }
},
{
    initialRouteName: Login,
    navigationOptions: { header: null }
});

export default createAppContainer(TopLevelSwitchNav);
</code></pre>

<p>Dependencies:</p>

<pre><code>"dependencies": {
    "expo": "^32.0.0",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
    "react-navigation": "^3.8.1",
    "react-redux": "^7.0.2",
    "redux": "^4.0.1",
    "redux-logger": "^3.0.6",
    "redux-persist": "^5.10.0",
    "redux-persist-transform-filter": "^0.0.18",
    "redux-thunk": "^2.3.0"
},
</code></pre>
