File tree Expand file tree Collapse file tree 6 files changed +36
-11
lines changed
resources/tentative/todomvc-react-18 Expand file tree Collapse file tree 6 files changed +36
-11
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ pnpm-debug.log*
8
8
lerna-debug.log *
9
9
10
10
node_modules
11
- dist
12
- dist-ssr
13
11
* .local
14
12
15
13
# Editor directories and files
Original file line number Diff line number Diff line change 3
3
< head >
4
4
< meta charset ="UTF-8 " />
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6
- < title > Vite + React + TS </ title >
6
+ < title > React 18 + Material UI + Vite </ title >
7
7
</ head >
8
8
< body >
9
9
< div id ="root "> </ div >
Original file line number Diff line number Diff line change 1
- export function App ( ) { }
1
+ export function App ( ) {
2
+ return (
3
+ < h1 > todos</ h1 >
4
+ ) ;
5
+ }
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ a:hover {
25
25
body {
26
26
margin : 0 ;
27
27
display : flex;
28
- place-items : center;
28
+ flex-direction : column;
29
+ align-items : center;
29
30
min-width : 320px ;
30
31
min-height : 100vh ;
31
32
}
@@ -49,9 +50,10 @@ button {
49
50
button : hover {
50
51
border-color : # 646cff ;
51
52
}
52
- button : focus ,
53
+
54
+ a : focus-visible ,
53
55
button : focus-visible {
54
- outline : 4px auto -webkit-focus-ring-color ;
56
+ outline : 4px auto blue ;
55
57
}
56
58
57
59
@media (prefers-color-scheme : light) {
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import ReactDOM from "react-dom/client" ;
3
- import CssBaseline from "@mui/material/CssBaseline " ;
4
- import App from "./App.tsx" ;
3
+ import { CssBaseline , ThemeProvider } from "@mui/material" ;
4
+ import { App } from "./components /App.tsx" ;
5
5
import "@fontsource/roboto/300.css" ;
6
6
import "@fontsource/roboto/400.css" ;
7
7
import "@fontsource/roboto/500.css" ;
8
8
import "@fontsource/roboto/700.css" ;
9
9
import "./index.css" ;
10
10
11
+ import { createTheme } from "@mui/material" ;
12
+
13
+ const theme = createTheme ( {
14
+ components : {
15
+ MuiButtonBase : {
16
+ defaultProps : {
17
+ // No more ripple, on the whole application 💣!
18
+ disableRipple : true ,
19
+ } ,
20
+ } ,
21
+ } ,
22
+ } ) ;
23
+
11
24
ReactDOM . createRoot ( document . getElementById ( "root" ) ! ) . render (
12
25
< React . StrictMode >
13
- < CssBaseline />
14
- < App />
26
+ < ThemeProvider theme = { theme } >
27
+ < CssBaseline />
28
+ < App />
29
+ </ ThemeProvider >
15
30
</ React . StrictMode >
16
31
) ;
Original file line number Diff line number Diff line change @@ -3,5 +3,11 @@ import react from "@vitejs/plugin-react";
3
3
4
4
// https://vitejs.dev/config/
5
5
export default defineConfig ( {
6
+ base : "./" , // Since this will be loaded from the project root
6
7
plugins : [ react ( ) ] ,
8
+ build : {
9
+ modulePreload : { polyfill : false } ,
10
+ minify : false ,
11
+ sourcemap : true ,
12
+ } ,
7
13
} ) ;
You can’t perform that action at this time.
0 commit comments