Skip to content

Commit 4a46ede

Browse files
authored
Fix typos in docs (#8256)
1 parent 11714bf commit 4a46ede

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/getting-started/concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ That's right, two of them!
415415
/teams/:teamId
416416
```
417417

418-
React Router has to make a decision here, there can be only one. Many routers, both client side and server side, will simply process the patterns in the order in which they were defined. First to match wins. In this case we would match `/` and render the `<Home/>` component. Definintely not what we wanted. These kinds of routers require us to order our routes perfectly to get the expected result. This is how React Router has worked up until v6, but now its much smarter.
418+
React Router has to make a decision here, there can be only one. Many routers, both client side and server side, will simply process the patterns in the order in which they were defined. First to match wins. In this case we would match `/` and render the `<Home/>` component. Definitely not what we wanted. These kinds of routers require us to order our routes perfectly to get the expected result. This is how React Router has worked up until v6, but now its much smarter.
419419

420420
Looking at those patterns, you intuitively know that we want `/teams/new` to match the URL `/teams/new`. It's a perfect match! React Router also knows that. When matching, it will rank your routes according the number of segments, static segments, dynamic segments, star patterns, etc. and pick the most specific match. You never have to think about ordering your routes.
421421

docs/guides/ssr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The most basic server rendering in React Router is pretty straightforward. Howev
1818
- Environment variables and secrets
1919
- Deployment
2020

21-
Setting all of this up well can be pretty involved but is worth the performance and UX charactertics you can only get when server rendering.
21+
Setting all of this up well can be pretty involved but is worth the performance and UX characteristics you can only get when server rendering.
2222

2323
If you want to server render your React Router app, we highly recommend you use [Remix](https://remix.run). This is another project of ours that's built on top of React Router and handles all of the things mentioned above and more. Give it a shot!
2424

docs/upgrading/reach.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ If your app has a `<Link to="/events" />` still hanging around and the user
290290
clicks it, the server isn't involved since you're using a client-side router.
291291
You'll need to be more diligent about updating your links 😬.
292292

293-
Alternatively, if you want to allow for out-dated links, _and you realize you need to configure your redirects on both the client and the server_, go ahead and copy paste the `Redirect` component we were about to ship but then deleted.
293+
Alternatively, if you want to allow for outdated links, _and you realize you need to configure your redirects on both the client and the server_, go ahead and copy paste the `Redirect` component we were about to ship but then deleted.
294294

295295
```jsx
296296
import { useEffect } from "react";
@@ -404,7 +404,7 @@ function PartialNavLink(props) {
404404

405405
#### Justification
406406

407-
"Prop getters" are clunky and can almost always be replaced with a hook. This also allows you to use the other hooks, like useLocation, and do even more custom things, like making a link active with a search string:
407+
"Prop getters" are clunky and can almost always be replaced with a hook. This also allows you to use the other hooks, like `useLocation`, and do even more custom things, like making a link active with a search string:
408408

409409
```jsx
410410
function RecentPostsLink(props) {
@@ -446,7 +446,7 @@ Also note the change from `uri -> url`.
446446

447447
#### Justification
448448

449-
Just feels cleaner to have the params be seperate from URL and path.
449+
Just feels cleaner to have the params be separate from URL and path.
450450

451451
Also nobody knows the difference between URL and URI, so we didn't want to start a bunch of pedantic arguments about it. React Router always called it URL, and it's got more production apps, so we used URL instead of URI.
452452

docs/upgrading/v5.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ cd ../../stats # pwd is /stats
518518
cd ../../../stats # pwd is /stats
519519
```
520520

521-
**Note**: The decision to ignore trailing slashes while matching and creating relative paths was not taken lightly by our team. We consulted with a number of our friends and clients (who are also our friends!) about it. We found that most of us don't even understand how plain HTML relative links are handled with the trailing slash. Most people guessed it worked like `cd` on the command line (it does not). Also, HTML relative links don't have the concept of nested routes, they only worked on the URL, so we had to blaze our own trail here a bit. `@reach/router` set this precendent and it has worked out well for a couple of years.
521+
**Note**: The decision to ignore trailing slashes while matching and creating relative paths was not taken lightly by our team. We consulted with a number of our friends and clients (who are also our friends!) about it. We found that most of us don't even understand how plain HTML relative links are handled with the trailing slash. Most people guessed it worked like `cd` on the command line (it does not). Also, HTML relative links don't have the concept of nested routes, they only worked on the URL, so we had to blaze our own trail here a bit. `@reach/router` set this precedent and it has worked out well for a couple of years.
522522

523523
In addition to ignoring trailing slashes in the current URL, it is important to note that `<Link to="..">` will not always behave like `<a href="..">` when your `<Route path>` matches more than one segment of the URL. Instead of removing just one segment of the URL, **it will resolve based upon the parent route's path, essentially removing all path segments specified by that route**.
524524

@@ -638,7 +638,7 @@ function App() {
638638
}
639639
```
640640

641-
If you need to replace the current location instead of push a new one onto the history stack, use `navigate(to, { replace: true })`. If you need state, use `navigate(to, { state })`. You can think of the first arg to `navigate` as your `<Link to>` and the other arg as the `replace` and `state` props.
641+
If you need to replace the current location instead of push a new one onto the history stack, use `navigate(to, { replace: true })`. If you need state, use `navigate(to, { state })`. You can think of the first argument to `navigate` as your `<Link to>` and the other arguments as the `replace` and `state` props.
642642

643643
If you prefer to use a declarative API for navigation (ala v5's `Redirect` component), v6 provides a `Navigate` component. Use it like:
644644

0 commit comments

Comments
 (0)