Change state in Redux DevTools Extension

In my application state, there are values ​​set as initialState.

Using React Developer Tools, it’s very easy to directly change any state value.

Is anything like this possible in the Redux DevTools Extension , i.e. click and paste a new value for a specific property?

In this SO, anwer stated that it is possible to “change everything you want,” but I cannot find how to do it.

In the Status → Unprocessed area (see the figure below), you can overwrite the values, but it does not seem to apply.

enter image description here

+13
source share
5

, ( , , ), enter image description here

, , , , .

+7

Redux , , .

, Redux DevTools, , , ( , AJAX ).

, ( createStore) window._store, window._store.dispatch({type: "...", ...}); .

+3

Redux Devtools - Redux. - action , . , ( ) Redux, :

, , .

, , , , , .

- , , , . , .

, , , , , , , , , , .

0

- .

Redux DevTools; :

3.0, . , , . , , ; 2 ( ) .

0

, .

During application development, it would be nice to quickly add a state fragment so that the application compiles ... by moving things. Here is the hack that I use to update the gearbox. The approach does not require the application to compile as long as the store is open, and, in any case, this is one of the motivations.


// quick what to add the 'selected' feature to my store; 
// the state store will update once I dispatch { type: 'HACK' }

export default createReducer(initialState, {
  HACK: state => ({
    ...state,
    selected: []
  }),
...
}

0
source

All Articles