bsky
bsky

Reputation: 20242

React code is not inserted into HTML

I have this HTML code:

<div id="myDiv"></div>

And this React code:

React.render(<h1>Hello</h1>, document.getElementById('myDiv'));

My issue is that the React statement has no effect. I thought this was because of some dependency issues in my project.

Now however, I created a fiddle and selected LOAD TYPE: onDomReady but still the React statement has no effect:

https://jsfiddle.net/2ejrce74/

Why is this the case?

Upvotes: 1

Views: 46

Answers (1)

Dimitris Karagiannis
Dimitris Karagiannis

Reputation: 9386

It's ReactDOM.render() not React.render().

See the top level API documentation.

Upvotes: 1

Related Questions