In my react-native redux app, in my mapStateToProps function, I need to combine some elements from state and some selectors created using reselect.
Basically, I have two things:
const mapStateToProps = (state) => ({
storedUserName: state.user.name,
isUserLoggedIn: state.user.isLoggedIn,
})
const mapStateToProps = createStructuredSelector({
email: emailSelector,
userData: userDataSelector
});
I need a way to combine these two so that I have all 4 props with only one mapStateToProps function. I just don't know how to do this. Please help.
Selectors are functions that take Redux state as an argument and return some data to pass to the component, like this:
You can do is