The page did not jump after isAuth modification?

modified isAuth to true, after clicking login on the login page, but the page did not jump to dashboard?

Auth.js

import React, { Component } from "react"
import { Redirect } from "react-router-dom"
import { connect } from "react-redux"

import { login } from "./Auth.redux"

// @connect(
//     state => state
// )
class Auth extends Component{
    handleClickLogin(){
        this.props.login()
    }
    render(){
        //console.log(this.props)
        return(
            <div>
                {this.props.isAuth ? <Redirect to="/dashboard" /> : null}
                

,

<button onClick={() => this.handleClickLogin()}></button> </div> ) } } const mapStateToProps = state => { return { auth: state.auth } } const authCreators = {login} export default connect(mapStateToProps, authCreators)(Auth)

Auth.redux.js

const LOGIN = "login"
const LOGOUT = "logout"

const initialState = {
    isAuth: false,
    username: "ok"
}

export function auth(state=initialState, action){
    switch(action.type){
        case LOGIN:
            return {...state, isAuth: true}
        case LOGOUT:
            return {...state, isAuth: false}
        default:
            return state
    } 
}

export function login(){
    return {type: LOGIN}
}

export function logout(){
    return {type: LOGOUT}
}

Apr.07,2021

there was an error in Auth.js and Dashboard.js getting isAuth from store. Because isAuth is placed in the object auth, it should be isAuth: state.auth.isAuth when getting it

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ef93-2bbd3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ef93-2bbd3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?