Skip to content

Commit 98bb2ca

Browse files
committed
update README.md
1 parent 996d067 commit 98bb2ca

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Load page component at `/src/pages` folder based on `window.location.pathname`
44

55
<br>
66

7+
### Install
8+
```
9+
yarn add react-dynamic-route
10+
```
11+
12+
<br>
13+
714
### Basic Usage
815
App.js
916
```jsx
@@ -14,7 +21,7 @@ export default function App() {
1421
return (
1522
<DynamicRoute
1623
page={path => import('./pages' + path).then(module => module.default)}
17-
loading={<Loading />}
24+
loading={<div>Loading..</div>}
1825
props={{
1926
someProp1,
2027
someProp2,
@@ -36,7 +43,7 @@ src/
3643
App.js
3744
```
3845

39-
Then, routes below
46+
Then, routed like below automatically
4047

4148
| path | component |
4249
| -------------- | --------------------------- |

0 commit comments

Comments
 (0)