Reputation: 67
I am new to React. I have this code and didn't get any console errors, still React isn't putting out anything on the screen.
This is my JSX code
var appComponent = React.createClass({
getDefaultProps: function(){
return {
appName: "First React
Application"
}
},
render: function(){
return(
<div>
<h1>{this.props.appName}</h1>
</div>
)
}
});
ReactDOM.render(
<appComponent />,
document.getElementById('app')
);
Upvotes: 1
Views: 106
Reputation: 67
I actually managed to solve it by capitalizing the first letter of the component, instead of appComponent, I wrote AppCompnent.
Upvotes: 1