zalmoxisus / remote-redux-devtools

Redux DevTools remotely.
http://zalmoxisus.github.io/monitoring/
MIT License
1.81k stars 139 forks source link

Config with Redux Toolkit #146

Closed angelod1as closed 3 years ago

angelod1as commented 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?

RichMatthews commented 3 years ago

how are you importing store?

angelod1as commented 3 years ago

I ended up switching to React Native Debugger

GeekaholicLin commented 3 years ago

the solution: https://github.com/reduxjs/redux-toolkit/issues/66#issuecomment-459980979