You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what's incorrect/missing in the documentation
In the manual installation instructions, it suggests creating an app/root.jsx file that exports Layout, HydrateFallback, ErrorBoundary, and a default component.
It looks to me like the Layout export is used when rendering the root route, but that the default export (named Root in the module) is unused (the "Hello, world!" content is not rendered).
Later, the docs say "Every route in routes.ts is nested inside the special app/root.tsx module."
This leaves me with a few questions:
Should the Layout component in app/root.jsx render the children prop (instead of rendering <Outlet/>)?
Should the default export from app/root.jsx render <Outlet/>?
Could the docs describe more specifically how the default and other named exports from app/root.jsx (especially Layout) are used (instead of just saying routes are "nested" in the special root module)?
I really appreciate the manual instructions and understand that this dev branch is still a work in progress.
The text was updated successfully, but these errors were encountered:
Yeah I found this confusing. It looked like the default Root export wasn't used anywhere, so I deleted it. This seemed fine in dev, but when I pre-rendered to HTML my pages were missing the stuff from Layout (i.e. just bare page HTML like <h1>About page</h1>.
I assume the presence of the default export is required for Layout to work somehow?
Describe what's incorrect/missing in the documentation
In the manual installation instructions, it suggests creating an
app/root.jsx
file that exportsLayout
,HydrateFallback
,ErrorBoundary
, and adefault
component.react-router/docs/start/installation.md
Lines 63 to 91 in 31a9ad8
It looks to me like the
Layout
export is used when rendering the root route, but that thedefault
export (namedRoot
in the module) is unused (the "Hello, world!" content is not rendered).Later, the docs say "Every route in
routes.ts
is nested inside the specialapp/root.tsx
module."This leaves me with a few questions:
Layout
component inapp/root.jsx
render thechildren
prop (instead of rendering<Outlet/>
)?default
export fromapp/root.jsx
render<Outlet/>
?default
and other named exports fromapp/root.jsx
(especiallyLayout
) are used (instead of just saying routes are "nested" in the special root module)?I really appreciate the manual instructions and understand that this
dev
branch is still a work in progress.The text was updated successfully, but these errors were encountered: