Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,4 @@
- xavier-lc
- xcsnowcity
- yuleicul
- lopezac
4 changes: 2 additions & 2 deletions docs/hooks/use-outlet-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Parent() {
}
```

```tsx lines=[2]
```tsx lines=[4]
import { useOutletContext } from "react-router-dom";

function Child() {
Expand All @@ -36,7 +36,7 @@ function Child() {

If you're using TypeScript, we recommend the parent component provide a custom hook for accessing the context value. This makes it easier for consumers to get nice typings, control consumers, and know who's consuming the context value. Here's a more realistic example:

```tsx filename=src/routes/dashboard.tsx lines=[12,17-19]
```tsx filename=src/routes/dashboard.tsx lines=[13, 19]
import * as React from "react";
import type { User } from "./types";
import { Outlet, useOutletContext } from "react-router-dom";
Expand Down