Skip to content

Commit 423c8dc

Browse files
rtmanntimdorrRyan Mann
authored
Fix: change children prop on navlink props to be optional (#8725)
Co-authored-by: Tim Dorr <timdorr@users.noreply.github.com> Co-authored-by: Ryan Mann <ryan.mann@petco.com>
1 parent 1100224 commit 423c8dc

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ body:
1616
you ask a question, here are some resources to get help first:
1717
1818
- Read the docs: https://reactrouter.com
19-
- Check out the list of frequently asked questions: https://reactrouter.com/docs/en/v6/getting-started/faq
19+
- Check out the list of frequently asked questions: https://reactrouter.com/docs/en/v6/faq
2020
- Explore examples: https://reactrouter.com/docs/en/v6/examples/basic
21-
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/ask?tags=react-router
21+
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/react-router
2222
- Ask in chat: https://discord.gg/6RyV8n8yyM
2323
2424
### Test Case Starter:

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ body:
1616
you ask a question, here are some resources to get help first:
1717
1818
- Read the docs: https://reactrouter.com
19-
- Check out the list of frequently asked questions: https://reactrouter.com/docs/en/v6/getting-started/faq
20-
- Explore examples: hhttps://reactrouter.com/docs/en/v6/examples/basic
21-
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/ask?tags=react-router
19+
- Check out the list of frequently asked questions: https://reactrouter.com/docs/en/v6/faq
20+
- Explore examples: https://reactrouter.com/docs/en/v6/examples/basic
21+
- Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/tagged/react-router
2222
- Ask in chat: https://discord.gg/6RyV8n8yyM
2323
- type: textarea
2424
attributes:

contributors.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,21 @@
1818
- IbraRouisDev
1919
- Isammoc
2020
- JakubDrozd
21+
- janpaepke
2122
- jmargeta
2223
- jonkoops
2324
- kantuni
2425
- kddnewton
2526
- kentcdodds
2627
- kkirsche
2728
- koojaa
29+
- KutnerUri
2830
- latin-1
2931
- liuhanqu
3032
- lukerSpringTree
3133
- markivancho
3234
- mcansh
35+
- mfijas
3336
- noisypigeon
3437
- paulsmithkc
3538
- petersendidit
@@ -40,8 +43,9 @@
4043
- shihanng
4144
- shivamsinghchahar
4245
- thisiskartik
46+
- ThornWu
4347
- timdorr
4448
- turansky
4549
- underager
4650
- vijaypushkin
47-
- KutnerUri
51+
- rtmann

docs/getting-started/concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ That's where a React Router specific `history` object comes into play. It provid
127127

128128
```js
129129
let history = createBrowserHistory();
130-
history.listen((location, action) => {
130+
history.listen(({ location, action }) => {
131131
// this is called whenever new locations come in
132132
// the action is POP, PUSH, or REPLACE
133133
});
@@ -668,7 +668,7 @@ The `PageLayout` route is admittedly weird. We call it a [layout route](#layout-
668668

669669
```jsx bad lines=[14-16,22-24]
670670
<Routes>
671-
<Routes path="/" element={<App />}>
671+
<Route path="/" element={<App />}>
672672
<Route index element={<Home />} />
673673
<Route path="teams" element={<Teams />}>
674674
<Route path=":teamId" element={<Team />} />

docs/getting-started/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default function Invoices() {
172172

173173
Finally, let's teach React Router how to render our app at different URLs by creating our first "Route Config" inside of `main.jsx` or `index.js`.
174174

175-
```tsx lines=[2,4-5,13-19] filename=src/main.jsx
175+
```tsx lines=[2,4-5,8-9,13-19] filename=src/main.jsx
176176
import { render } from "react-dom";
177177
import {
178178
BrowserRouter,
@@ -806,7 +806,7 @@ export function deleteInvoice(number) {
806806
807807
Now let's add the delete button, call our new function, and navigate to the index route:
808808

809-
```js lines=[1-2,5-6,17-26] filename=src/routes/invoice.jsx
809+
```js lines=[1-6,20-29] filename=src/routes/invoice.jsx
810810
import {
811811
useParams,
812812
useNavigate,

packages/react-router-dom/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ if (__DEV__) {
290290

291291
export interface NavLinkProps
292292
extends Omit<LinkProps, "className" | "style" | "children"> {
293-
children:
293+
children?:
294294
| React.ReactNode
295295
| ((props: { isActive: boolean }) => React.ReactNode);
296296
caseSensitive?: boolean;

0 commit comments

Comments
 (0)