index.js
index.html
import React from 'react';
import ReactDOM from 'react-dom';
class Test extends React.Component {
render() {
return <h1>Hello World!</h1>;
}
}
ReactDOM.render(<Test />, document.getElementById('root'));
/*
The examples in this tutorial are created using the
create-react-app. Install the create-react-app,
and you will be able to run the same examples on your computer.
In this example we create a component called 'Test'.
The component is rendered in a container called 'root'.
Click the 'index.html' tab to see the container.
*/
<!DOCTYPE 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>