User ReactJS on Web Page (without compile)

Thitipong Samranvarnich
3 min readMay 13, 2021

goto page https://reactjs.org/docs/add-react-to-a-website.html#add-react-in-one-minute

  • install xampp , start service apache (only)
  • create folder test-reactjs-2021 in C:\xampp\htdocs , goto this new folder
  • create file index.html
  • create file app.js
  • I use vscode as editor
  • Must connect to Internet to test this demo
  • Add html code to index.html

- Add Babel (CDN) to support SJX Syntax

Add Script code to index.html (1, 2) , in 2 type=”text/babel”

  • Add Root div tag , I named as ‘root’ for easier (easier for me)
  • Add React CDN to HTML
  • Add very basic ReactJS Component Code to app.js
  • Start Create React Component in Code ( in app.js , below of file )
  • Then goto output url , Success
  • Test Click Button , result is …
  • Success !!

Then I modify Code

and result is

--

--