Skip to content

Commit be7acee

Browse files
committed
chore: update react app to latest
1 parent 29f8a28 commit be7acee

File tree

10 files changed

+1398
-1193
lines changed

10 files changed

+1398
-1193
lines changed

react/my-awesome-app/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# React + 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/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

react/my-awesome-app/cypress/support/component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import './commands'
1919
// Alternatively you can use CommonJS syntax:
2020
// require('./commands')
2121

22-
import { mount } from 'cypress/react18'
22+
import { mount } from 'cypress/react'
2323

2424
Cypress.Commands.add('mount', mount)
2525

react/my-awesome-app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

react/my-awesome-app/package-lock.json

Lines changed: 1363 additions & 1167 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

react/my-awesome-app/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12-
"react": "^18.2.0",
13-
"react-dom": "^18.2.0"
12+
"react": "^18.3.1",
13+
"react-dom": "^18.3.1"
1414
},
1515
"devDependencies": {
16-
"@types/react": "^18.2.42",
17-
"@types/react-dom": "^18.2.17",
18-
"@vitejs/plugin-react": "^3.1.0",
19-
"cypress": "^13.6.1",
20-
"vite": "^4.5.1"
16+
"@types/react": "^18.3.12",
17+
"@types/react-dom": "^18.3.1",
18+
"@vitejs/plugin-react": "^4.3.4",
19+
"cypress": "https://cdn.cypress.io/beta/npm/13.16.1/darwin-arm64/feat/support_svelte_5-fe87cdeb0bda14ba83786d31cb9863f308be3ae1/cypress.tgz",
20+
"globals": "^15.12.0",
21+
"vite": "^6.0.1"
2122
}
2223
}

react/my-awesome-app/src/App.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
height: 6em;
1010
padding: 1.5em;
1111
will-change: filter;
12+
transition: filter 300ms;
1213
}
1314
.logo:hover {
1415
filter: drop-shadow(0 0 2em #646cffaa);

react/my-awesome-app/src/App.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import { useState } from 'react'
22
import reactLogo from './assets/react.svg'
3+
import viteLogo from '/vite.svg'
34
import './App.css'
45

56
function App() {
67
const [count, setCount] = useState(0)
78

89
return (
9-
<div className="App">
10+
<>
1011
<div>
11-
<a href="https://vitejs.dev" target="_blank">
12-
<img src="/vite.svg" className="logo" alt="Vite logo" />
12+
<a href="https://vite.dev" target="_blank">
13+
<img src={viteLogo} className="logo" alt="Vite logo" />
1314
</a>
14-
<a href="https://reactjs.org" target="_blank">
15+
<a href="https://react.dev" target="_blank">
1516
<img src={reactLogo} className="logo react" alt="React logo" />
1617
</a>
1718
</div>
@@ -27,7 +28,7 @@ function App() {
2728
<p className="read-the-docs">
2829
Click on the Vite and React logos to learn more
2930
</p>
30-
</div>
31+
</>
3132
)
3233
}
3334

react/my-awesome-app/src/index.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
:root {
2-
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3-
font-size: 16px;
4-
line-height: 24px;
2+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3+
line-height: 1.5;
54
font-weight: 400;
65

76
color-scheme: light dark;
@@ -12,7 +11,6 @@
1211
text-rendering: optimizeLegibility;
1312
-webkit-font-smoothing: antialiased;
1413
-moz-osx-font-smoothing: grayscale;
15-
-webkit-text-size-adjust: 100%;
1614
}
1715

1816
a {

react/my-awesome-app/src/main.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from 'react'
2-
import ReactDOM from 'react-dom/client'
3-
import App from './App'
1+
import { StrictMode } from 'react'
2+
import { createRoot } from 'react-dom/client'
43
import './index.css'
4+
import App from './App.jsx'
55

6-
ReactDOM.createRoot(document.getElementById('root')).render(
7-
<React.StrictMode>
6+
createRoot(document.getElementById('root')).render(
7+
<StrictMode>
88
<App />
9-
</React.StrictMode>
9+
</StrictMode>,
1010
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
33

4-
// https://vitejs.dev/config/
4+
// https://vite.dev/config/
55
export default defineConfig({
6-
plugins: [react()]
6+
plugins: [react()],
77
})

0 commit comments

Comments
 (0)