Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-router): ensure links and scripts are available on routes created with createRoute #2854

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GregoryCollett
Copy link

We found that creating a route with createRoute would not expose links and scripts where as when creating a route with createFileRoute the link and script properties would exist as expected. We expect the behaviour to be the same across the board.

…with createFileRoute work routes created with createRoute did not
@schiller-manuel
Copy link
Contributor

we need a test for this

Copy link

nx-cloud bot commented Nov 26, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ae4c28c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@SeanCassiere SeanCassiere changed the title Ensure links and scripts are available on routes created with createRoute fix(react-router): ensure links and scripts are available on routes created with createRoute Nov 26, 2024
Copy link

pkg-pr-new bot commented Nov 26, 2024

Open in Stackblitz

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@2854

@tanstack/create-router

npm i https://pkg.pr.new/@tanstack/create-router@2854

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@2854

@tanstack/react-cross-context

npm i https://pkg.pr.new/@tanstack/react-cross-context@2854

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@2854

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@2854

@tanstack/react-router-with-query

npm i https://pkg.pr.new/@tanstack/react-router-with-query@2854

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@2854

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@2854

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@2854

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@2854

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@2854

@tanstack/start

npm i https://pkg.pr.new/@tanstack/start@2854

@tanstack/start-vite-plugin

npm i https://pkg.pr.new/@tanstack/start-vite-plugin@2854

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@2854

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@2854

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@2854

commit: ae4c28c

@@ -2528,6 +2528,8 @@ export class Router<
loaderData,
})
const meta = headFnContent?.meta
const links = headFnContent?.links
Copy link
Contributor

@schiller-manuel schiller-manuel Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this worked in createFileRoute but not in createRoute. can you explain this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants