我们如何在争论中使用setState中的componentDidMount钩子?subscriptions and asynchronous tasks in the in DiscoverPage (created by Route)import React, { Component } from 'react';
import { Switch, Route, Redirect }
我正在使用react路由器扩展在我的应用程序中定义react路由。一切都很好,但问题是,如果我使用es6语法来定义类App.js,那么index.js“不能将类作为函数来调用”。或者有什么合适的方法来解决这个问题?这些是我的react路由器文件和app.js文件。以下是react-router库的github链接
import React from 'reac
Error: You should not use <Link> outside a <Router>App.jsximport {BrowserRouter as Router,Route,Link,Switch,Redirect,browserHistory} from 'react-router-dom';
class App e