« React + Vite + TS » : différence entre les versions
Apparence
Aucun résumé des modifications |
|||
Ligne 21 : | Ligne 21 : | ||
); | ); | ||
</filebox> | </filebox> | ||
<kode lang='bash'> | |||
# install the NodeJS packages | |||
npm i | |||
# start | |||
npm start | |||
</kode> |
Version du 25 octobre 2024 à 21:05
Links
Exemple
public/index.html |
<body>
<!-- hosts the React application -->
<div id="app"></div>
<!-- import index.js generated from index.jsx by a bundler such as Snowpack -->
<script type="module" src="/dist/index.js"></script>
</body>
|
src/index.jsx |
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('app')
);
|
# install the NodeJS packages
npm i
# start
npm start
|