main.jsx
index.html
import { createRoot } from 'react-dom/client'
//Check out the index.html file, were we have added some styles.
function Car() {
const x = "myclass";
return (
<h1 className={x}>Hello World</h1>
);
}
createRoot(document.getElementById('root')).render(
<Car />
);
<!DOCTYPE html>
<html lang="en">
<!--This is not how we should add styles in React,
but for demo purposes, it is ok: -->
<style>
.myclass {
color: red;
}
</style>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>