Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 使用react返回值_Reactjs - Fatal编程技术网

Reactjs 使用react返回值

Reactjs 使用react返回值,reactjs,Reactjs,我的代码如下,但不显示“hello world” 我的代码有问题吗 请帮忙 <html> <head> <script src="theme/public/js/react.production.min.js"></script> <script src="theme/public/js/react-dom.production.min.js"></script> </head> <body

我的代码如下,但不显示“hello world”

我的代码有问题吗

请帮忙

<html> 
<head>   
<script src="theme/public/js/react.production.min.js"></script>   
<script src="theme/public/js/react-dom.production.min.js"></script>
</head>
 <body>
   <div id="root"></div>
   <script type="text/babel">
     ReactDOM.render(
       <h1>Hello, world!</h1>,
       document.getElementById('root')
     );
   </script>
 </body>
 </html>

ReactDOM.render(
你好,世界!,
document.getElementById('root'))
);

您还需要导入巴别塔

这来自使用开发版本的官方文档


你好,世界
ReactDOM.render(
你好,世界!,
document.getElementById('root'))
);
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello World</title>
    <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">

      ReactDOM.render(
        <h1>Hello, world!</h1>,
        document.getElementById('root')
      );

    </script>
    <!--
      Note: this page is a great way to try React but it's not suitable for production.
      It slowly compiles JSX with Babel in the browser and uses a large development build of React.

      To set up a production-ready React build environment, follow these instructions:
      * https://reactjs.org/docs/add-react-to-a-new-app.html
      * https://reactjs.org/docs/add-react-to-an-existing-app.html

      You can also use React without JSX, in which case you can remove Babel:
      * https://reactjs.org/docs/react-without-jsx.html
      * https://reactjs.org/docs/cdn-links.html
    -->
  </body>
</html>