We have
<body>
<div id="root"></div>
</body>
In React
import React from 'react';
import { render } from 'react-dom';
class Welcome extends React.Component { constructor(props) {
super(props);
}
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}if (document.getElementById('root')) { ReactDOM.render( <Welcomename="John" />, document.getElementById('root') );
}
No comments:
Post a Comment