Relative Content

Tag Archive for reactjsreact-reduxredux-toolkit

problems with Redux

The problem is that if I use a Provider in my index.js, all my components disappear.

Authentication – Login form with remember me option

I have one question about Authentication part – actually I have login form with remember me checkbox, I am confused, from backend I get accessToken,refreshToken and refreshTokenExpiration, how need to handle it when I click remember me, when I don’t click rememberMe? Where I need to save that tokens which I get? I read storing tokens in localStorage is not secure. I use React, redux toolkit.

hi everyone, i have an error with redux that state.items is undefine

import { createSlice } from “@reduxjs/toolkit”; export const cartSlice = createSlice({ name: ‘cart’, initialState: { items: localStorage.getItem(‘cart’) ? JSON.parse(localStorage.getItem(‘cart’)).items : [] }, reducers: { addToCart: (state, action) => { // kiểm tra thử sản phẩm đó đã tồn tại chưa nêu chưa thì thêm , nếu có rồi thì tăng số lượng if (state.items.find((item) => […]