There's also another way. If you use htm you can skip babel. And with the es-react package you can reduce the boilerplate a little bit.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>single page react boilerplate</title> <meta name="description" content="The HTML5 Herald"> <meta name="author" content="your-name-here"> </head> <body> <div id="place-app"> </div> <script type="module"> import { React, ReactDOM } from "https://unpkg.com/es-react"; import htm from 'https://unpkg.com/htm?module'; const html = htm.bind(React.createElement); var App = (props) => { return html` <div> Hello Universe! </div> `; }; ReactDOM.render(App(), document.getElementById('place-app')); </script> </body> </html>
Nice!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There's also another way. If you use htm you can skip babel. And with the es-react package you can reduce the boilerplate a little bit.
Nice!