Reputation: 1785
This is a very simple page that is trying to use Redux....see code below.
However Im getting the error object is not a constructor (evaluating 'new ctor(props context)')
import React, {Component} from 'react';
import {Text, View} from 'react-native';
import {connect} from 'react-redux';
const mapStateToProps = state => ({
userId: state.auth.userId,
});
class Message extends Component {
render() {
return (
<View>
<Text>Text here</Text>
</View>
);
}
}
export default connect(
mapStateToProps,
null,
)(Message);
Upvotes: 20
Views: 15530
Reputation: 91
for the yarn user, I tried this, totally works
yarn cache clean
Upvotes: 3
Reputation: 682
Reset cache work for me:
react-native start --reset-cache
Other solution is use createSwitchNavigator
instead createStackNavigator
, in your navigator container.
Upvotes: 43