From 9592c830377e9a88fee175a1525bc4082269fd3a Mon Sep 17 00:00:00 2001 From: BrianT1414 <32641907+BrianT1414@users.noreply.github.com> Date: Thu, 17 Feb 2022 16:09:59 -0600 Subject: [PATCH 1/3] Add import statement to useOutletContext example I added an import for the `useOutletContext` hook API documentation example to be consistent with other examples. Also based on [this SO question](https://stackoverflow.com/questions/71165826/failing-to-access-outlet-context-in-react) the absence of the import has caused some confusion. --- docs/api.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api.md b/docs/api.md index f01d1144f0..6ffa98947e 100644 --- a/docs/api.md +++ b/docs/api.md @@ -646,6 +646,7 @@ If you're using TypeScript, we recommend the parent component provide a custom h ```tsx filename=src/routes/dashboard.tsx lines=[12,17-19] import * as React from "react"; import type { User } from "./types"; +import { useOutletContext } from "react-router-dom"; type ContextType = { user: User | null }; From 5cec0a0cf8a457821921fbf516f71e2b8c1a7c47 Mon Sep 17 00:00:00 2001 From: BrianT1414 <32641907+BrianT1414@users.noreply.github.com> Date: Thu, 17 Feb 2022 16:14:43 -0600 Subject: [PATCH 2/3] Update contributors.yml --- contributors.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.yml b/contributors.yml index 099a6ca58a..dae0398f6d 100644 --- a/contributors.yml +++ b/contributors.yml @@ -2,6 +2,7 @@ - Ajayff4 - awreese - bhbs +- BrianT1414 - brockross - chaance - chasinhues From 34f415b5320d48485d21ef0837e39069dfa15022 Mon Sep 17 00:00:00 2001 From: Tim Dorr Date: Thu, 17 Feb 2022 20:38:02 -0500 Subject: [PATCH 3/3] Update docs/api.md --- docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 6ffa98947e..a55824b907 100644 --- a/docs/api.md +++ b/docs/api.md @@ -646,7 +646,7 @@ If you're using TypeScript, we recommend the parent component provide a custom h ```tsx filename=src/routes/dashboard.tsx lines=[12,17-19] import * as React from "react"; import type { User } from "./types"; -import { useOutletContext } from "react-router-dom"; +import { Outlet, useOutletContext } from "react-router-dom"; type ContextType = { user: User | null };