|
1 | | -# React |
2 | | - |
3 | | -Take a look at the following files of this example to see the required code: |
4 | | - |
5 | | -Your files go here |
6 | | - |
7 | | -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
8 | | - |
9 | | -## Available Scripts |
10 | | - |
11 | | -In the project directory, you can run: |
12 | | - |
13 | | -### `npm start` |
14 | | - |
15 | | -Runs the app in the development mode.<br> |
16 | | -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
17 | | - |
18 | | -The page will reload if you make edits.<br> |
19 | | -You will also see any lint errors in the console. |
20 | | - |
21 | | -### `npm run build` |
22 | | - |
23 | | -Builds the app for production to the `build` folder.<br> |
24 | | -It correctly bundles React in production mode and optimizes the build for the best performance. |
25 | | - |
26 | | -The build is minified and the filenames include the hashes.<br> |
27 | | -Your app is ready to be deployed! |
28 | | - |
29 | | -See the section about [deployment](https://create-react-app.dev/docs/deployment/) for more information. |
| 1 | +# React + TypeScript + Vite |
| 2 | + |
| 3 | +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. |
| 4 | + |
| 5 | +Currently, two official plugins are available: |
| 6 | + |
| 7 | +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh |
| 8 | +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
| 9 | + |
| 10 | +## Expanding the ESLint configuration |
| 11 | + |
| 12 | +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: |
| 13 | + |
| 14 | +```js |
| 15 | +export default tseslint.config({ |
| 16 | + extends: [ |
| 17 | + // Remove ...tseslint.configs.recommended and replace with this |
| 18 | + ...tseslint.configs.recommendedTypeChecked, |
| 19 | + // Alternatively, use this for stricter rules |
| 20 | + ...tseslint.configs.strictTypeChecked, |
| 21 | + // Optionally, add this for stylistic rules |
| 22 | + ...tseslint.configs.stylisticTypeChecked, |
| 23 | + ], |
| 24 | + languageOptions: { |
| 25 | + // other options... |
| 26 | + parserOptions: { |
| 27 | + project: ['./tsconfig.node.json', './tsconfig.app.json'], |
| 28 | + tsconfigRootDir: import.meta.dirname, |
| 29 | + }, |
| 30 | + }, |
| 31 | +}) |
| 32 | +``` |
| 33 | + |
| 34 | +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: |
| 35 | + |
| 36 | +```js |
| 37 | +// eslint.config.js |
| 38 | +import reactX from 'eslint-plugin-react-x' |
| 39 | +import reactDom from 'eslint-plugin-react-dom' |
| 40 | + |
| 41 | +export default tseslint.config({ |
| 42 | + plugins: { |
| 43 | + // Add the react-x and react-dom plugins |
| 44 | + 'react-x': reactX, |
| 45 | + 'react-dom': reactDom, |
| 46 | + }, |
| 47 | + rules: { |
| 48 | + // other rules... |
| 49 | + // Enable its recommended typescript rules |
| 50 | + ...reactX.configs['recommended-typescript'].rules, |
| 51 | + ...reactDom.configs.recommended.rules, |
| 52 | + }, |
| 53 | +}) |
| 54 | +``` |
30 | 55 |
|
31 | 56 | ## Further help |
32 | 57 |
|
33 | | -You can learn more about React in the [Create React App documentation](https://create-react-app.dev/docs/getting-started/). |
34 | | - |
35 | | -To get more help on DevExtreme submit an issue on [GitHub](https://github.com/DevExpress/devextreme/issues) or [Support Center](https://www.devexpress.com/Support/Center/Question/Create) |
36 | | - |
37 | | - |
| 58 | +You can learn more about React in the [React documentation](https://18.react.dev/learn). |
38 | 59 |
|
| 60 | +To get more help on DevExtreme submit an issue in the [Support Center](https://www.devexpress.com/Support/Center/Question/Create) |
0 commit comments