我试图在组件加载之前更改菜单,以便可以根据用户登录显示不同的菜单。我已经用componentWillMount尝试过这种方法,我尝试过在登录两类用户中的一种时设置超时。
我希望在重定向用户登录后重新加载页面,或者在组件加载到页面之前更改变量链接。
class Navbar extends Component {
state = {
links: <SignedOutLinks />
}
checkMenu() {
let links = <SignedOutLinks />;
if (this.props.toxiCookie === unde
我试图在登录后将用户重定向到主页,重定向发生了(我知道这是因为url改变了,我转到了一个新的页面),但是页面的内容没有加载。我一直收到这个错误 Warning: You tried to redirect to the same route you're currently on: "/index" 下面是我的Login.js代码: import React, { Component } from 'react';
import '../App.css';
import 'whatwg-fetch';
import {