Redux devtools with redux toolkit not working

1.2k views Asked by At

I am trying to implement redux toolkit in to my react native project. Well the integration was successfull, however i am unable to get the redux dev tools to work. I did a bit of research and couldnt find any article related to redux toolkit and react native in combination. If anyone knows how to use the dev tools with rtk and react native, would be a great help

1

There are 1 answers

0
Carmine Tambascia On

Usually when the redux dev tool is inactive / grayed out in react application, can mean that the store is not been initialized(passed as a prop), this maybe also your case, but I haven't used yet in RN. Maybe better to add a codesanbox to better check.

In general could be that you have forgot the commented part :

import { createSlice, PayloadAction } from '@reduxjs/toolkit'

export interface CounterState {
 value: number
}

const initialState: CounterState = {  //--> part you my have forgot to define
  value: 0,
}

or you have maybe forgot to connect the store to the app:

...
...
import { Provider } from "react-redux"
import { store } from "./app/store"

ReactDOM.render(
  <React.StrictMode>
    <Provider store={store}>  // --> connecting the store
      <App />
    </Provider>  
  </React.StrictMode>,
  document.getElementById('root')
);