score:1

Accepted answer

in your handlesubmit function you need to call the handlelogin from props so the state is correctly updated in your container component.

 handlesubmit(event) {
...

.then((response) => {
            let token = response.data.access_token;
            this.setstate({
                redirect: true,
                token: token,
                loading: false
            });
           // here, call the handle from props
           this.props.handlelogin(token);
        }

...

that way, your this.state.authed will have the proper value


Related Query

More Query from same tag