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: make to required if from is not set #3099

Merged
merged 2 commits into from
Jan 4, 2025
Merged

fix: make to required if from is not set #3099

merged 2 commits into from
Jan 4, 2025

Conversation

chorobin
Copy link
Contributor

@chorobin chorobin commented Jan 2, 2025

Fixes #2797

Copy link

nx-cloud bot commented Jan 2, 2025

View your CI Pipeline Execution ↗ for commit 293096e.

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 1m 13s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-04 17:48:42 UTC

Copy link

pkg-pr-new bot commented Jan 2, 2025

Open in Stackblitz

More templates

@tanstack/arktype-adapter

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

@tanstack/create-start

npm i https://pkg.pr.new/@tanstack/create-start@3099

@tanstack/eslint-plugin-router

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

@tanstack/create-router

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

@tanstack/react-cross-context

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

@tanstack/history

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

@tanstack/react-router

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

@tanstack/react-router-with-query

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

@tanstack/router-cli

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

@tanstack/router-devtools

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-vite-plugin

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

@tanstack/start

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

@tanstack/start-vite-plugin

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 293096e

@chorobin chorobin force-pushed the make-to-required branch 3 times, most recently from 8a10a13 to 45fc2ac Compare January 4, 2025 17:40
@chorobin chorobin merged commit 04802fb into main Jan 4, 2025
5 checks passed
@chorobin chorobin deleted the make-to-required branch January 4, 2025 17:48
@aboqasem
Copy link

aboqasem commented Jan 11, 2025

does this mean to must be a valid path? if not, would it be possible to allow any string? because after upgrading we have to suppress typescript:

import { createFileRoute, redirect } from "@tanstack/react-router";

export const Route = createFileRoute("/ar/$")({
	beforeLoad: (opts) => {
        throw redirect({
            // @ts-expect-error -- if the path doesn't exist, 404 will be shown
			to: `/${opts.params._splat ?? ""}`,
			...opts,
		});
	},
});

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.

Typescript issue when navigating without passing the to
2 participants