In my application state there are values set as initialState.
With the React Developer Tools it's very easy to directly modify some state value.
Is anything similar possible in Redux DevTools Extension, i.e. click and insert a new value for a specific property?
In this SO anwer it's stated that it's possible to "change whatever you want", but I cannot find how.
In the State -> Raw pane (see pic below) one can overwrite values but it doesn't seem to be applied.
The great thing about Redux Devtools is it adheres well to Redux's principles. The only way you should be changing the state is by dispatching an
action
with whatever custom parameters you want and then let the reducer handle the state change logic. This is preferred so it adheres to the second principle (state is read-only) and the third principle of Redux which states:So the way you would make a state change is to define a specific action that changes the piece of state you want through the reducer.
There is a very important reason for this -- this way you can verify whatever state you are trying to test is actually a possible state that your application can end up in. If you mutated bits and pieces of the state directly, it's possible your application might never reach that state.
It might seem tedious but this means that if you wanted to try and test a complex state your application could hit, you'd have to dispatch all the correct actions in order to get to that state but at least you know that is a possible state your application will run into and how your users can hit that state.