Redux mapStateToProps call only once

Redux mapStateToProps call only once



It's been 2 days that I'm stuck with an issue implementing redux in my react native application. I checked many topics but I can't fix my problem.

The problem is that mapStateToProps is called only once but it's not called anymore after executing action. My reducer is called but the state is not updating.

I test my work on android with android studio and emulator.

Here is my code :


  <Provider store={createStore(reducers)}>
         <MainScreen />


export default (state = INITIAL_STATE, action) => {
  switch (action.type) {
    case SET_HEADER:
      return action.payload;
      return state;



import { combineReducers } from 'redux';
import HeaderReducer from './HeaderReducer';

export default combineReducers({ headerText: HeaderReducer, });


export const SET_HEADER = 'set_header';

export const setHeaderText = (title) => { return { type: SET_HEADER, payload: title, }; };


import * as actions from '../actions';

... <Text> {this.props.headerText} </Text> <Button onPress={() => { this.props.setHeaderText(screen: ${SELECTED_PAGE.profile}); this.forceUpdate(); }} >


const mapStateToProps = (state) => { const { headerText } = state; return { headerText }; };

export default connect(mapStateToProps, actions)(MainScreen);

I know that I don't need to forceUpdate in the onPress callback but it's just to check the state after call the function.

So when the application start the reducers are called and my mapStateToProps is working. But when I click on my button, my reducers are called, the good action is executed in the switch but my mapStateToProps is not called anymore. When I click a second time if I console.log the state in my reducer I can see that the state is not updated but stay the same than the INITIAL_STATE.

I don't mutate the state in my reducers, I connected everything in my MainScreen.js and I wrapped my app in Provider with store.

I follow a tutorial on Udemy to implement reduc in my app and even I check the code of the tuto on github, I can't find out where the issue is from (

I think I miss something really obvious but I can't find out what's wrong since 2 days :/

If someone can help, I would appreciate :)


redux react-native

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Hire Dedicated React Native Developer

Have you ever thought of having your own app that runs smoothly over multiple platforms? React Native is an open-source cross-platform mobile application framework which is a great option to create mobile apps for both Android and iOS. **[Hire...

Accessing Redux from Components In React & React Native

How to set up a basic version of Redux in your React or React Native application. To make things clearer, I based my setup on my event application, where users create events that other users attend. We generated the action creators, reducers, and Redux store, and wrapped the application in a provider.

A Basic Redux Setup in React/React Native

Redux is a powerful state management tool that can be very useful as your React or React Native application grows and requires you to keep track of more state.

React Native Mobile App Development

Skenix is providing React Native Development Services with qualified React Native App Developers. Get the best React Native App Development Services.