When attempting to create a slice using Redux Toolkit within the Visual Studio Code editor, I encounter a TypeScript warning that states "Property 'value' may not exist on type 'boolean'. Did you mean 'valueOf'?" This occurs when trying to set a state value to boolean in the following way:
import {createSlice} from '@reduxjs/toolkit';
export const authSlice = createSlice({
name: 'auth',
initialState: false, // user is not logged-in
reducers: {
login: (state) => {state.value = true},
logout: (state) => {state.value = false}
}
});
Adding to my confusion, I am utilizing JavaScript instead of TypeScript. Can someone please point out what I might be misunderstanding or unexpectedly doing?