我的 index.js 文件中出现错误:
Failed to compile src\index.js
Line 5:1: 'reactDOM' is not defined no-undef
搜索关键字以了解有关每个错误的更多信息。 此错误发生在构建期间,无法消除。
我在 index.js 中的代码是:
import React from "react";
import ReactDOM from "react-dom";
const element = <h1>Hello, World!</h1>
reactDOM.render(element, document.getElementById("root"))
我在 Windows 机器上。
请尽可能快速准确地帮助我。
答案 0 :(得分:0)
它应该是 ReactDOM
而不是 reactDOM
(在 ReactDOM.render 中)。