简体   繁体   English

反应时收到 no-undef 错误怎么办?

[英]what can I do when receiving no-undef error on react?

I get this error when trying to run the page...尝试运行页面时出现此错误...

import React from "react";
import reactDom from "react-dom";

const element = <h1>Hello World</h1>;
ReactDOM.render(element, document.getElementById('root'));

I think this is a syntax error, reactDom is not the same as ReactDom can you try:我认为这是一个语法错误, reactDomReactDom不一样你可以试试:

import React from "react";
import ReactDom from "react-dom";

const element = <h1>Hello World</h1>;
ReactDom.render(element, document.getElementById("root"));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM