Skip to content

Conversation

@burakcan
Copy link
Contributor

Context: #4027

Changes the ViewTransitionOptions["types"] to also accept a function. This enables automatically applying different animations (for example sliding left or right) based on history navigation. When navigating via history.back()/forward(), it’s very common to want a "slide-left" vs "slide-right" effect based on direction.

This technically also works for Links but it's not as useful there since the prop can already be dynamic. This is mostly for navigations that are triggered via other sources than links.

@SeanCassiere SeanCassiere changed the title feat(router): support dynamic defaultViewTransition types eat(router-core): allow dynamic ViewTransition types Apr 23, 2025
@SeanCassiere SeanCassiere changed the title eat(router-core): allow dynamic ViewTransition types feat(router-core): allow dynamic ViewTransition types Apr 23, 2025
@nx-cloud
Copy link

nx-cloud bot commented Apr 23, 2025

View your CI Pipeline Execution ↗ for commit 419373a.

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 5m 32s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-23 01:40:07 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 23, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@4031

@tanstack/create-router

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

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@4031

@tanstack/eslint-plugin-router

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

@tanstack/create-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/create-start@4031

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@4031

@tanstack/react-router

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

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@4031

@tanstack/react-router-with-query

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

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@4031

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@4031

@tanstack/react-start-config

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-config@4031

@tanstack/react-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-plugin@4031

@tanstack/react-start-router-manifest

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-router-manifest@4031

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@4031

@tanstack/router-cli

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

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@4031

@tanstack/router-devtools

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

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@4031

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@4031

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@4031

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@4031

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@4031

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@4031

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@4031

@tanstack/solid-start-config

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-config@4031

@tanstack/solid-start-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-plugin@4031

@tanstack/solid-start-router-manifest

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-router-manifest@4031

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@4031

@tanstack/start

npm i https://pkg.pr.new/TanStack/router/@tanstack/start@4031

@tanstack/start-api-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-api-routes@4031

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@4031

@tanstack/start-config

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-config@4031

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@4031

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-client@4031

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-fetcher@4031

@tanstack/start-server-functions-handler

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-handler@4031

@tanstack/start-server-functions-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-server@4031

@tanstack/start-server-functions-ssr

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-functions-ssr@4031

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@4031

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@4031

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@4031

commit: 419373a

@SeanCassiere SeanCassiere merged commit 1f2642b into TanStack:main Apr 23, 2025
6 of 7 checks passed
@SeanCassiere
Copy link
Member

@burakcan thank you for adding this in!

@burakcan
Copy link
Contributor Author

Thank you for the quick review @SeanCassiere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants