Skip to content

Instantly share code, notes, and snippets.

@kentcdodds
Last active June 24, 2021 19:48
Show Gist options
  • Save kentcdodds/5274dfa1eb31e6d22b9eddd1efc773dc to your computer and use it in GitHub Desktop.
Save kentcdodds/5274dfa1eb31e6d22b9eddd1efc773dc to your computer and use it in GitHub Desktop.
The one true react boilerplate
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>
@joshgillies
Copy link

I did something like this last year for hyperHTML: https://gist.github.com/joshgillies/bff1e5f6e9ab62869abd6f73c1d22606

Basically:

   <body>
    <div id="root"></div>
    <script src="https://unpkg.com/hyperhtml"></script>
    <script>
      function tick(render) {
        render`
          <div>
            <h1>Hello, world!</h1>
            <h2>It is ${new Date().toLocaleTimeString()}.</h2>
          </div>
        `
      }
      setInterval(tick, 1000,
        hyperHTML.bind(document.getElementById('root'))
      )
    </script>
  </body>

@steve-taylor
Copy link

Simple HTML boilerplate

<body>
<div>Hello World!</div>
</body>

@robjac
Copy link

robjac commented Jun 24, 2021

Simple HTML boilerplate

<body>
<div>Hello World!</div>
</body>

LMAO brilliant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment