File tree Expand file tree Collapse file tree
examples/create-react-app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,10 +6,8 @@ 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- - [ jsconfig.json] ( ./jsconfig.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
12- - a reusable [ Layout.jsx ] ( ./src/components/Layout/Layout.jsx ) that:
10+ - a reusable [ Layout.js ] ( ./src/components/Layout/Layout.js ) that:
1311 - updates all the icons to use ` SVGIcon ` s instead of ` FontIcon ` s
1412 - initializes the ` Layout ` component from ` react-md ` with navigation items
1513 - uses [ react-router-dom] ( https://www.npmjs.com/package/react-router-dom ) as the routing library
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1515 "react" : " ^17.0.1" ,
1616 "react-dom" : " ^17.0.1" ,
1717 "react-md" : " latest" ,
18- "react-router-dom" : " ^5.2.0 " ,
18+ "react-router-dom" : " ^6.0.2 " ,
1919 "react-scripts" : " 4.0.3" ,
2020 "sass" : " ^1.37.5" ,
2121 "web-vitals" : " ^2.1.0"
Original file line number Diff line number Diff line change 1+ import { Routes , Route } from 'react-router-dom' ;
2+
3+ import Layout from './components/Layout' ;
4+ import Home from './components/Home' ;
5+ import Route1 from './components/Route1' ;
6+
7+ export default function App ( ) {
8+ return (
9+ < Layout >
10+ < Routes >
11+ < Route path = "/" element = { < Home /> } />
12+ < Route path = "route-1" element = { < Route1 /> } />
13+ </ Routes >
14+ </ Layout >
15+ ) ;
16+ }
Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
You can’t perform that action at this time.
0 commit comments