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): upgrade to react-store 0.7 #3075

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"dependencies": {
"@tanstack/history": "workspace:*",
"@tanstack/react-store": "^0.6.1",
"@tanstack/react-store": "^0.7.0",
"jsesc": "^3.0.2",
"tiny-invariant": "^1.3.3",
"tiny-warning": "^1.0.3"
Expand Down
8 changes: 4 additions & 4 deletions packages/react-router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
createMemoryHistory,
parseHref,
} from '@tanstack/history'
import { Store } from '@tanstack/react-store'
import { Store, batch } from '@tanstack/react-store'
import invariant from 'tiny-invariant'
import warning from 'tiny-warning'
import { rootRouteId } from './root'
Expand Down Expand Up @@ -1959,7 +1959,7 @@ export class Router<

let pendingMatches!: Array<AnyRouteMatch>

this.__store.batch(() => {
batch(() => {
// this call breaks a route context of destination route after a redirect
// we should be fine not eagerly calling this since we call it later
// this.clearExpiredCache()
Expand Down Expand Up @@ -2014,7 +2014,7 @@ export class Router<
let enteringMatches!: Array<AnyRouteMatch>
let stayingMatches!: Array<AnyRouteMatch>

this.__store.batch(() => {
batch(() => {
this.__store.setState((s) => {
const previousMatches = s.matches
const newMatches = s.pendingMatches || s.matches
Expand Down Expand Up @@ -2877,7 +2877,7 @@ export class Router<
])

// If the matches are already loaded, we need to add them to the cachedMatches
this.__store.batch(() => {
batch(() => {
matches.forEach((match) => {
if (!loadedMatchIds.has(match.id)) {
this.__store.setState((s) => ({
Expand Down
56 changes: 28 additions & 28 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading