答案 0 :(得分:1)
使用ReactDOM.render
渲染路径时,将其渲染为React组件而不是函数调用。另外,为了渲染组件,JSX标记需要以大写字符
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import MarketPlace from './MarketPlace';
import registerServiceWorker from './registerServiceWorker';
import { render } from 'react-dom'
import Routes from "./routes.js"
ReactDOM.render(<Routes/>, document.getElementById('root'));
registerServiceWorker();