Why is the react grammar written like this?

1. Now I"m going to work on the react project

.

which version should I use?
the latest is react 16, react-router4.0, webpack4.0? These three?

=

< html >
< head >

<meta charset="UTF-8" />
<title> React </title>
<script src="https://cdn.bootcss.com/react/15.4.2/react.min.js"></script>
<script src="https://cdn.bootcss.com/react/15.4.2/react-dom.min.js"></script>
<script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>

< / head >
< body >

<div id="example"></div>
<script type="text/babel">
  var arr = [
    <h1></h1>,
    <h2></h2>,
  ];
  ReactDOM.render(
    <div>{arr}</div>,
    document.getElementById("example")
  );
</script>

< / body >

< H1 > < / html > < / H1 > Why don"t the H1 and H2 tags in the array arr in the

code be enclosed in quotation marks? Isn"t it a string?
and here the quality will appear key warning

Mar.13,2021

react jsx Syntax


Why don't the H1 and H2 tags in the array arr in the
code be enclosed in quotation marks? Isn't it a string?

I think you should go to the official website to find out the basic grammar of react , instead of asking all questions here, and it is recommended to read the official documentation to learn

.

https://reactjs.org/docs/add-.
recommends using the official create-react-app tool to create a react project. Dependencies will help you match it

.
Menu