Returns the original document by default. Returns the updated document if returnNewDocument is set to true or returnDocument is set to after.
import { configureStore } from "@reduxjs/toolkit";
import blog from "./slices/blogSlice";
const rootReducer = combineReducers({
blog: blog
})
export const store = configureStore({
reducer: rootReducer
});
const newData = data.map((n, i, a) => ({
...n,
newSick: n.sick - (i < ~-a.length && a[-~i].sick),
}));
data.forEach((n, i, a) => n.newSick = n.sick - (a[i + 1]?.sick ?? 0));
// или
data.reduceRight((prev, n) => (n.newSick = n.sick - prev, n.sick), 0);
activeType
указывайте не 0
, а нулевой элемент из types
:React.useState(0);
---> React.useState(types[0]);
в чем заключаются загвостки