For example when I have a component like this
class SomeComponent extends Component {
render() {
const { someState1, someState2 } = this.props
return( <View>
<Component1 prop1={someState1} />
<Component2 prop2 ={someState2}} />
</View>
);
}
}
const mapStateToProps = state =>({
someState1: state.action.someState1,
someState2:state.action.someState2
});
export default connect(mapStateToProps)(SomeComponent);
Even though the rule says it detects the use of local states, constructors, or render returning something other than JSX before triggering the warning. For some reason it does not detect the use of redux and says it should be a pure function, especially when the redux states are being passed down. I just want to know if this is a bug or if this is intentional. Thank you.
It should be a pure function - that you're calling your props "state" doesn't make them state, they're just props. redux has state, but SomeComponent does not.
Most helpful comment
It should be a pure function - that you're calling your props "state" doesn't make them state, they're just props. redux has state, but
SomeComponentdoes not.