Skip to content

Commit 69cf974

Browse files
committed
📖 DOC: How to add react router DOM
1 parent 29c1994 commit 69cf974

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ let menu=null;
142142
}
143143
```
144144
145-
## Lecture 6: React Spring
145+
## Lecture 6: React Spring (Animations)
146146
147147
- Install react-spring
148148
`yarn add react-spring`
@@ -168,3 +168,20 @@ const menuTransitions = useTransition(showMenu,null, {
168168
)
169169
}
170170
```
171+
## Lecture 6: React Router
172+
173+
- Install React Router DOM
174+
`yarn add react-router-dom`
175+
- Add necessary imports
176+
```import {
177+
BrowserRouter as Router,
178+
Switch,
179+
Route,
180+
Link
181+
} from 'react-router-dom'
182+
```
183+
- Make sure `Router` encapsulates at the topmost level
184+
185+
- Router can contain `Link` which defines navigation URL
186+
187+
- Router can contain `Switch` which in turn contains `Route` which acts as a router outlet for specified links

0 commit comments

Comments
 (0)