Skip to content

Commit

Permalink
docs(file-conventions/root): fix wording (#9947)
Browse files Browse the repository at this point in the history
  • Loading branch information
udohjeremiah authored Sep 10, 2024
1 parent 745056e commit 4664132
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@
- twhitbeck
- tylerbrostrom
- udasitharani
- udohjeremiah
- uerkw
- uhoh-itsmaciek
- unhackit
Expand Down
2 changes: 1 addition & 1 deletion docs/file-conventions/root.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function ErrorBoundary() {

Because your `Layout` component is used in both success and error flows, this same restriction holds. If you need to fork logic in your `Layout` depending on if it was a successful request or not, you can use `useRouteLoaderData("root")` and `useRouteError()`.

<docs-warn>Because your `<Layout>` component is used for rendering the `ErrorBoundary`, you should be _very defensive_ to ensure that you can render your `ErrorBoundary` without encountering any render errors. If your `Layout` throws another error trying to render the boundary, then it can't can't be used and your UI will fall back to the very minimal built-in default `ErrorBoundary`.</docs-warn>
<docs-warn>Because your `<Layout>` component is used for rendering the `ErrorBoundary`, you should be _very defensive_ to ensure that you can render your `ErrorBoundary` without encountering any render errors. If your `Layout` throws another error trying to render the boundary, then it can't be used and your UI will fall back to the very minimal built-in default `ErrorBoundary`.</docs-warn>

```tsx filename="app/root.tsx" lines=[6-7,19-29,32-34]
export function Layout({
Expand Down

0 comments on commit 4664132

Please sign in to comment.