Skip to content

Commit

Permalink
doc: updated reach migration guide for Route Components (#8491)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaypushkin committed Dec 16, 2021
1 parent 0d14f74 commit eeb7a57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions contributors.yml
Expand Up @@ -20,3 +20,4 @@
- thisiskartik
- timdorr
- turansky
- vijaypushkin
14 changes: 7 additions & 7 deletions docs/upgrading/reach.md
Expand Up @@ -204,10 +204,10 @@ import { Router } from "@reach/router";
</Router>;

// React Router v6
import { Routes } from "react-router-dom";
import { Routes, Route } from "react-router-dom";

<Routes>
<Home path="/" />
<Route path="/" element={<Home />} />
{/* ... */}
</Routes>;
```
Expand All @@ -225,8 +225,8 @@ The `default` prop told `@reach/router` to use that route if no other routes mat

// React Router v6
<Routes>
<Home path="/" />
<NotFound path="*" />
<Route path="/" element={<Home />} />
<Route path="*" element={<NotFound />} />
</Routes>
```

Expand Down Expand Up @@ -306,9 +306,9 @@ function Redirect({ to }) {

// usage
<Routes>
<Home path="/" />
<Users path="/events" />
<Redirect path="/dashboard" to="/events" />
<Route path="/" element={<Home />} />
<Route path="/events" element={<Users />} />
<Route path="/dashboard" element={<Redirect to="/events" />} />
</Routes>;
```

Expand Down

0 comments on commit eeb7a57

Please sign in to comment.