Question about this React syntax

On https://blog.hubspot.com/website/react-js, the principle of React is explained quite well. But at about halfway the page, just under “Step 3: Crafting the React Component” there is a syntax that I don’t understand.

It’s about the line ReactDOM.render(, container);

That does not call the constant ActualWidget, so how does the browser know that it should fill the container with Hello World?

I would said is a mistake that the author haven’t notice while writing the blog.

But of course it would to be tested in code to make sure that is the case.

1 Like

That’s what it indeed would look like. Unfortunately, the author doesn’t give his contact details.

Here is the test. How you can see it error out

Now no error. Hello world is printed

1 Like