You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createReducer<Todo[],TodosAction>([],{[getType(todos.add)](state=[],action): Todo[]{return[...state,action.payload];//get error , don't know which payload should be },});
If I add the following script , it will remove error but it's hard to use.
Sometimes don't want to use
switch case
grammar , use official provide functioncreateReducer
, the link is https://redux.js.org/recipes/reducing-boilerplate#generating-reducersI added typescript like this:
and
Todos
reducers isIf I add the following script , it will remove error but it's hard to use.
Can help improve above function? Thanks !
The text was updated successfully, but these errors were encountered: