DEV Community

Discussion on: Redux Toolkit - The Standard Way to Write Redux

Collapse
 
lowla profile image
Laureline Paris

After practicing a bit I had my answer:

  • createSlice and createReducer are using internally Immer ( package handling immutable data structure. ) : this is why it we can provide the updated value like so.

the toolkit is really nice however this is unfortunate that such official opinionated tool implies confusing habits ( such as re-assigning the value straight away affected ) whereas the the fundamental principal of the mature react library was enforcing the habit to not mutate directly the value pre and post hooks.