File tree Expand file tree Collapse file tree 5 files changed +14
-18
lines changed
examples/create-react-app-typescript Expand file tree Collapse file tree 5 files changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
66
77This example will setup an example Create React App + ReactMD app that has the following features:
88
9- - [ tsconfig.json] ( ./tsconfig.json ) to allow absolute imports instead of relative imports from the ` "src" ` directory
10- - ` import MyComponent from "components/MyComponent" ` instead of ` import MyComponent from "../../components/MyComponent" `
119- [ \_ everything.scss] ( ./src/_everything.scss ) to override the default ` react-md ` theme and feature toggles
1210- a reusable [ Layout.tsx] ( ./src/components/Layout/Layout.tsx ) that:
1311 - updates all the icons to use ` SVGIcon ` s instead of ` FontIcon ` s
Original file line number Diff line number Diff line change 1616 "@types/node" : " ^16.6.1" ,
1717 "@types/react" : " ^17.0.17" ,
1818 "@types/react-dom" : " ^17.0.9" ,
19- "@types/react-router-dom" : " ^5.1.5" ,
2019 "react" : " ^17.0.1" ,
2120 "react-dom" : " ^17.0.1" ,
2221 "react-md" : " latest" ,
23- "react-router-dom" : " ^5.2.0 " ,
22+ "react-router-dom" : " ^6.0.2 " ,
2423 "react-scripts" : " 4.0.3" ,
2524 "sass" : " ^1.36.0" ,
2625 "typescript" : " ^4.0.3" ,
Original file line number Diff line number Diff line change 11import type { ReactElement } from "react" ;
2- import { Route , Switch } from "react-router-dom" ;
2+ import { Routes , Route } from "react-router-dom" ;
33
4- import Layout from "components/Layout" ;
5- import Home from "components/Home" ;
6- import Route1 from "components/Route1" ;
4+ import Layout from "./ components/Layout" ;
5+ import Home from "./ components/Home" ;
6+ import Route1 from "./ components/Route1" ;
77
88export default function App ( ) : ReactElement {
99 return (
1010 < Layout >
11- < Switch >
12- < Route path = "/" exact component = { Home } />
13- < Route path = "/ route-1" component = { Route1 } />
14- </ Switch >
11+ < Routes >
12+ < Route path = "/" element = { < Home /> } />
13+ < Route path = "route-1" element = { < Route1 /> } />
14+ </ Routes >
1515 </ Layout >
1616 ) ;
1717}
Original file line number Diff line number Diff line change 1- import ReactDOM from "react-dom" ;
21import "./index.scss" ;
2+ import ReactDOM from "react-dom" ;
3+ import { BrowserRouter } from "react-router-dom" ;
4+
35import App from "./App" ;
4- import { BrowserRouter as Router } from "react-router-dom" ;
56import reportWebVitals from "./reportWebVitals" ;
67
78ReactDOM . render (
8- < Router >
9+ < BrowserRouter >
910 < App />
10- </ Router > ,
11+ </ BrowserRouter > ,
1112 document . getElementById ( "root" )
1213) ;
1314
Original file line number Diff line number Diff line change 22 "compilerOptions" : {
33 "target" : " es5" ,
44 "lib" : [" dom" , " dom.iterable" , " esnext" ],
5- "baseUrl" : " src" ,
6- "rootDir" : " src" ,
75 "allowJs" : true ,
86 "skipLibCheck" : true ,
97 "esModuleInterop" : true ,
You can’t perform that action at this time.
0 commit comments