Closed angelod1as closed 3 years ago
I have the following code:
import { configureStore, createSlice } from '@reduxjs/toolkit' import devToolsEnhancer from 'remote-redux-devtools' const counterSlice = createSlice({ name: 'counter', initialState: 0, reducers: { increment: (state) => state + 1, decrement: (state) => state - 1, }, }) const { increment, decrement } = counterSlice.actions const store = configureStore({ reducer: counterSlice.reducer, enhancers: [devToolsEnhancer], }) export default store
When I run the app, it throws an exception:
TypeError: getState is not a function. (In 'getState()', 'getState' is undefined)
I couldn't find in the docs a way to configure this with Redux Toolkit, is there anything I'm missing?
how are you importing store?
I ended up switching to React Native Debugger
the solution: https://github.com/reduxjs/redux-toolkit/issues/66#issuecomment-459980979
I have the following code:
When I run the app, it throws an exception:
I couldn't find in the docs a way to configure this with Redux Toolkit, is there anything I'm missing?