Element type is invalid: expected a string (for built-in components) or a class/function

后端 未结 9 593
谎友^
谎友^ 2020-12-03 21:11
import React from \'react\';
import ReactDOM from \'react-dom\';
import Map from \'./components/map/container/map\';
import App from \'./App\';
import \'./index.css\         


        
9条回答
  •  猫巷女王i
    2020-12-03 21:17

    I also had the similar problem while attempting to add routes into my application. I then realised that i was importing { BrowserRouter, Route } from "react-router"; instead of correctly importing it from react-router-dom as below import { BrowserRouter, Route } from "react-router-dom". Thanks to the online community

提交回复
热议问题