Reputation: 743
Why this doesn't work? I was following a youtube tutorial.
function Hello(props) {
return <div>Hello</div>;
}
ReactDOM.render(
Hello,
document.getElementById('entry')
);
http://codepen.io/anon/pen/VmqJGp
Upvotes: 1
Views: 89
Reputation: 161457
If you look at the JS console of that page you will see the following:
Following that link, the error page states
ReactDOM.render(): Invalid component element. Instead of passing a class like Foo, pass React.createElement(Foo) or
<Foo />
so instead of
ReactDOM.render(
Hello,
document.getElementById('entry')
);
you should do
ReactDOM.render(
<Hello />,
document.getElementById('entry')
);
Upvotes: 2