Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: updated reach migration guide for Route Components #8491

Merged
merged 2 commits into from Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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