Hello, I'm new to React Native and I'm having trouble getting the status of a reducer for a component I made. it is as follows:
import React from 'react'
import { connect } from 'react-redux'
import { View, Text } from 'react-native'
class Foo extends React.Component {
render() {
const foo = !!this.props.isEnabled ? 'sim!' : 'não!';
return <View><Text>{foo}</Text></View>
}
}
const mapStateToProps = state => {
console.log(state);
return { isEnabled: state.fooReducer.isEnabled }
}
const mapDispatchToProps = {}
export default connect(mapStateToProps, mapDispatchToProps)(Foo);
The redux is working and I can see the state change from the console.log()
I put in mapStateToProps
I just can not pass that state to the component and use it to manipulate the render.
What do I need to do to use this state inside the render?