<!DOCTYPE html>
<html lang="en">
<head>
<title>JSX</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div id="root"></div>
<script src="../src/index.js" type="text/javascript"></script>
</body>
</html>
import React from "react";
import ReactDOM from "react-dom";
import App from "./components/App";
ReactDOM.render(
<App />,
document.getElementById("root")
);
import React from "react";
function Heading(){
return <h1 className="blue">Mes plats favoris</h1>
}
export default Heading;
import React from "react";
function Liste(){
return (
<ul>
<li>Jambon</li>
<li>Omelette</li>
<li>Pates</li>
</ul>
);
}
export default Liste;
import React from "react";
import Heading from "./Heading";
import Liste from "./Liste";
function App() {
return (
<div>
<Heading />
<Liste />
</div>
);
}
export default App;
Testez vos propres exemples sous codesandbox. Cliquez ici