July 2017
Beginner to intermediate
340 pages
7h 43m
English
The JSX syntax extension (https://facebook.github.io/jsx/) adds XML tags to JS, and can be used by tools like ReactJS when the rendering of the page happens. It is promoted by the ReactJS community as the best way to write React apps.
In the following example, a <script> section contains a div variable whose value is an XML tree representing a div. This syntax is valid JSX. From there, the ReactDOM.render() function can render the div variable in the DOM.
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> </head> <body> <div id="content"></div> <script src="/static/react/react.min.js"></script> <script src="/static/react-dom.min.js"></script> <script src="/static/babel/browser.min.js"></script> <script ...Read now
Unlock full access