Skip to content

Can't get the simplest of react apps rendering #2

Description

@McGroover-Bottleneck

I have the minimum hello world like so

import React from 'react';
import ReactDOM from 'react-dom';

console.log('Bundle loading')
ReactDOM.render(
    <h1>Hello, world!</h1>,
    document.getElementById('root')
  );

I then have a simple index.html

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="theme-color" content="#000000" />
  <meta name="description" content="Web site created using create-react-app" />
  <link rel="apple-touch-icon" href="logo192.png" />

  <title>React App</title>
</head>

<body>
  <noscript>You need to enable JavaScript to run this app.</noscript>
  <div id="root"></div>
  <script src="../dist/build/static/js/bundle.min.js"></script>
</body>

</html>

This should simple render a Hello World but doesnt!

What am I doing wrong?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions