docs(rtl): fix TanStack Start root route example#10425
Open
yogeshwaran-c wants to merge 1 commit intoshadcn-ui:mainfrom
Open
docs(rtl): fix TanStack Start root route example#10425yogeshwaran-c wants to merge 1 commit intoshadcn-ui:mainfrom
yogeshwaran-c wants to merge 1 commit intoshadcn-ui:mainfrom
Conversation
Update the `__root.tsx` snippet in the TanStack Start RTL guide to match the current TanStack Start patterns used by the shadcn start templates: - Import `createRootRoute`, `HeadContent`, and `Scripts` from `@tanstack/react-router`. - Use `shellComponent: RootDocument` instead of `component: RootComponent`. - Destructure `children` on `RootDocument` so `<DirectionProvider>` receives a defined value. - Replace `<Meta />` with `<HeadContent />`. - Refresh the highlighted line numbers.
Contributor
|
@yogeshwaran-c is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Documentation fix.
What is the current behavior?
The
Add DirectionProviderstep on docs/rtl/start shows asrc/routes/__root.tsxsnippet that does not compile and does not match the current TanStack Start API used by thestart-app/start-monorepotemplates in this repo:createRootRoute,HeadContent, andScriptsare referenced without being imported.component: RootComponent, butRootComponenttakes no props and then references an undefined{children}identifier inside the<DirectionProvider>.<Meta />, which is not exported from@tanstack/react-router; TanStack Start exposesHeadContentfor head metadata.Users copying this snippet into a fresh TanStack Start project hit a TypeScript error (
Cannot find name 'children') and a runtime import error for<Meta />.What is the new behavior?
The snippet is updated to match
templates/start-app/src/routes/__root.tsx:createRootRoute,HeadContent,Scriptsimports from@tanstack/react-router.shellComponent: RootDocumentand rename the function toRootDocument.{ children }: { children: React.ReactNode }onRootDocumentso<DirectionProvider>receives a defined value.<Meta />with<HeadContent />.DirectionProviderimport,<html dir="rtl">, and the<DirectionProvider direction="rtl">wrapper).Only
apps/v4/content/docs/rtl/start.mdxis touched; no changeset is needed since thev4docs app is listed underignorein.changeset/config.json.