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

refactor(react-router): expose scrollBehavior on the ScrollRestoration component #3053

Merged
merged 5 commits into from
Dec 21, 2024

Conversation

joshuaKnauber
Copy link
Contributor

Exposes the scroll behavior option for the ScrollRestoration component.

Currently the scrollTo only receives the x and y which makes it animate smoothly. If we always want to force an instant jump to the last point we should be able to set the behavior.

@joshuaKnauber joshuaKnauber marked this pull request as ready for review December 21, 2024 00:05
Copy link

nx-cloud bot commented Dec 21, 2024

View your CI Pipeline Execution ↗ for commit 8d03040.

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

☁️ Nx Cloud last updated this comment at 2024-12-21 23:46:39 UTC

Copy link

pkg-pr-new bot commented Dec 21, 2024

Open in Stackblitz

More templates

@tanstack/arktype-adapter

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

@tanstack/create-router

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

@tanstack/eslint-plugin-router

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

@tanstack/history

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

@tanstack/create-start

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

@tanstack/react-cross-context

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

@tanstack/react-router

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

@tanstack/react-router-with-query

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

@tanstack/router-cli

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

@tanstack/router-devtools

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-vite-plugin

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

@tanstack/start

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

@tanstack/start-vite-plugin

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

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 8d03040

Copy link
Member

@SeanCassiere SeanCassiere left a comment

Choose a reason for hiding this comment

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

@joshuaKnauber looks like your changing of the import ordering in the packages/react-router/src/scroll-restoration.tsx file has broken eslint. Please use the eslint suggestions and fix the ordering.

@schiller-manuel
Copy link
Contributor

please update docs

docs/framework/react/guide/scroll-restoration.md

@SeanCassiere SeanCassiere changed the title Add scroll behavior option for ScrollRestoration feat(react-router): expose scrollBehavior on the ScrollRestoration component Dec 21, 2024
@SeanCassiere SeanCassiere changed the title feat(react-router): expose scrollBehavior on the ScrollRestoration component refactor(react-router): expose scrollBehavior on the ScrollRestoration component Dec 21, 2024
@SeanCassiere
Copy link
Member

@joshuaKnauber thank you for contributing this in 🎉

@SeanCassiere SeanCassiere merged commit 72b7c82 into TanStack:main Dec 21, 2024
5 checks passed
@joshuaKnauber
Copy link
Contributor Author

@joshuaKnauber thank you for contributing this in 🎉

Thank you for reviewing and for all your guys work!

@joshuaKnauber joshuaKnauber deleted the feat-scroll-behavior branch December 22, 2024 08:52
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