Skip to content

Commit

Permalink
fix(react-router): upgrade to react-store 0.7 (#3075)
Browse files Browse the repository at this point in the history
  • Loading branch information
schiller-manuel authored Dec 26, 2024
1 parent 233526c commit 9970f9d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
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.

0 comments on commit 9970f9d

Please sign in to comment.