| index.html |
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React App</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
|
| index.js |
import React from 'react';
import ReactDOM from 'react-dom';
class Test extends React.Component {
render( ) {
return <h3>Hello, World!</h3>;
}
}
ReactDOM.render( <Test />, document.getElementById( 'root' ) );
/* This example creates a component called "Test," which is rendered
in a container called "root" in the "index.html."
*/
|
| localhost: 3000 |
Hello, World! |