Postingan lainnya
Referenceerror: localstorage is not defined di reactjs
import React from 'react'
import axios from 'axios'
const axiosReq = axios.create()
const AuthStudentContext = React.createContext()
export class AuthStudentContextProvider extends React.Component {
constructor() {
super()
this.state = {
students: [],
student: localStorage.getItem('student') || {},
token: localStorage.getItem('token') || "",
isLoggedIn: (localStorage.getItem('student' == null)) ? false : true
}
}
0
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban