When you use Redux Toolkit (createSlice), Immer automatically creates a draft copy of the state so that you can "mutate" it directly. However:
If state is a primitive (number, string, boolean) → Immer cannot create a draft because drafts only work on reference types (objects/arrays).
When state is an array or object → Immer tracks changes and applies them correctly.
let loggerSlice = createSlice({
name:"logger",
initialState:"", //will not work instead use { msg :""}
})