Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

64
Vistas
TypeError: (0, _$$_REQUIRE(_dependencyMap[0], "redux").createStore) is not a function react-native

I'm new in redux I'm trying to connect redux with react native when I set all and In App.js i add <provider store={store}> it display me that error: TypeError: (0, _$$_REQUIRE(_dependencyMap[0], "redux").createStore) is not a function.

App.js

import { Counter } from './assets/counter';
import { Provider } from 'react-redux';
import {store} from './assets/store/store'
const App= (props) => {
  return (
    <View style={{flex:1}}>
      <Provider store={store} >
        <Counter/>
      </Provider>
    </View>
  );
};


export default App;

cunter.js

export const Counter = (props) =>{
    return(
        <View style={{flex:1,justifyContent:'center', alignItems:'center'}} >
            <Button title="Add Inc"  />
            <Text>Counter</Text>
            <Button title="Add Dec"  />
        </View>
    )
}

store.js

import {createStore} from 'redux'
import {mainReducer} from './reducers'


export const store = createStore(mainReducer)

reducer.js

import {ADDITION, SUBTRACTION} from './actionType'

const initialState = {
    counter:0
}

export const mainReducer=(state=initialState, action)=>{
    switch (action.type) {
        case ADDITION:
            return {...state, counter:state.counter+1}
        case SUBTRACTION:
            return {...state, counter:state.counter-1}
    
        default:
            return state
    }
}

package.json

  "dependencies": {
    "react": "17.0.1",
    "react-native": "0.64.2",
    "react-redux": "^7.2.4",
    "redux": "^4.1.1"
  },
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

i have same problem but its solved and i just want to share.. its all happen because "npx react-native init Redux" well i try to create another react-native init with different name and move all folder from old one that i named it "Redux" then its all running normal.. so do not try to create folder or event project name with same modul thats we installed via NPM.. hope its help and enjoy your day.. thank you..

about 4 years ago · Juan Pablo Isaza Denunciar

0

For anyone running into a similar issue - I fixed this by removing a dependancy cycle in my import statements.

E.g. A imports from B imports from A.

I had to move the function I was importing from A into file B (so B did not import from A).

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda