|<meta charset="UTF-8" />|
|<title>Add React in One Minute</title>|
|<h2>Add React in One Minute</h2>|
|<p>This page demonstrates using React with no build tooling.</p>|
|<p>React is loaded as a script tag.</p>|
|<!-- We will put our React component inside this div. -->|
|<!-- Load React. -->|
|<!-- Note: when deploying, replace "development.js" with "production.min.js". -->|
|<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>|
|<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>|
|<!-- Load our React component. -->|
This example shows React without JSX.
Adding JSX to a project doesn’t require complicated tools like a bundler or a development server. Essentially, adding JSX feels a lot like adding a CSS preprocessor.
Learn more in this documentation section: http://reactjs.org/docs/add-react-to-a-website.html#add-jsx-to-a-project
solution : use <ContentLoader.Facebook />
Is this still working? I just tried on both local server and within an online site and no luck. The React button failed to load, only the html text up to "React is loaded as a script tag." showed. No errors indicated in console either. For both tests I used exactly the same code as provided.
The web unfortunately has many tutorials that do not work, this now joins the crowd. At least the title "Add React in a minute" meant not too much time was lost, in my case about an hour. After Googling I came up with another simple one-page tutorial that worked right away: https://medium.com/@to_pe/how-to-add-react-to-a-simple-html-file-a11511c0235f.
What if we use JSX in like_button.js file which also use ES2015 import statement like so :
Incredibly disappointing that such a simple example meant to showcase how simple this framework can be, does not work.
You should end up with:
<script type="text/babel" src="like_button.js"></script>`