3

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

Sjonchhe
  • 790
  • 8
  • 16
  • 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 – Carmine Tambascia Feb 04 '22 at 14:12
  • why didn't you write the code how to create and add store to the project? We don't know how to deliver babies and fix a car engine over the phone – BuGaGa Dec 22 '22 at 03:10

1 Answers1

0

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')
);
Carmine Tambascia
  • 1,628
  • 2
  • 18
  • 32