在使用react-router-dom时,报警告。 解决: 使用replace <NavLink exact to="/" replace>首页</NavLink> or <Link exact to="/" replace>首页</Link>