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);
Reset cache work for me:
react-native start --reset-cache
Other solution is use createSwitchNavigator
instead createStackNavigator
, in your navigator container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With