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*
88lerna-debug.log *
99
1010node_modules
11- dist
12- dist-ssr
1311* .local
1412
1513# Editor directories and files
Original file line number Diff line number Diff line change 33 < head >
44 < meta charset ="UTF-8 " />
55 < 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 >
77 </ head >
88 < body >
99 < 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 {
2525body {
2626 margin : 0 ;
2727 display : flex;
28- place-items : center;
28+ flex-direction : column;
29+ align-items : center;
2930 min-width : 320px ;
3031 min-height : 100vh ;
3132}
@@ -49,9 +50,10 @@ button {
4950button : hover {
5051 border-color : # 646cff ;
5152}
52- button : focus ,
53+
54+ a : focus-visible ,
5355button : focus-visible {
54- outline : 4px auto -webkit-focus-ring-color ;
56+ outline : 4px auto blue ;
5557}
5658
5759@media (prefers-color-scheme : light) {
Original file line number Diff line number Diff line change 11import React from "react" ;
22import 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" ;
55import "@fontsource/roboto/300.css" ;
66import "@fontsource/roboto/400.css" ;
77import "@fontsource/roboto/500.css" ;
88import "@fontsource/roboto/700.css" ;
99import "./index.css" ;
1010
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+
1124ReactDOM . createRoot ( document . getElementById ( "root" ) ! ) . render (
1225 < React . StrictMode >
13- < CssBaseline />
14- < App />
26+ < ThemeProvider theme = { theme } >
27+ < CssBaseline />
28+ < App />
29+ </ ThemeProvider >
1530 </ React . StrictMode >
1631) ;
Original file line number Diff line number Diff line change @@ -3,5 +3,11 @@ import react from "@vitejs/plugin-react";
33
44// https://vitejs.dev/config/
55export default defineConfig ( {
6+ base : "./" , // Since this will be loaded from the project root
67 plugins : [ react ( ) ] ,
8+ build : {
9+ modulePreload : { polyfill : false } ,
10+ minify : false ,
11+ sourcemap : true ,
12+ } ,
713} ) ;
You can’t perform that action at this time.
0 commit comments