@tanstack/router-core 0.0.1-beta.199 → 0.0.1-beta.200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/router-core",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.199",
4
+ "version": "0.0.1-beta.200",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router",
@@ -44,7 +44,7 @@
44
44
  "tiny-warning": "^1.0.3",
45
45
  "@tanstack/store": "^0.0.1",
46
46
  "@gisatcz/cross-package-react-context": "^0.2.0",
47
- "@tanstack/history": "0.0.1-beta.199"
47
+ "@tanstack/history": "0.0.1-beta.200"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "rollup --config rollup.config.js",
package/src/router.ts CHANGED
@@ -1852,16 +1852,12 @@ export class Router<
1852
1852
  #commitLocation = async (next: ParsedLocation & CommitLocationOptions) => {
1853
1853
  if (this.navigateTimeout) clearTimeout(this.navigateTimeout)
1854
1854
 
1855
- let nextAction: 'push' | 'replace' = 'replace'
1856
-
1857
- if (!next.replace) {
1858
- nextAction = 'push'
1859
- }
1860
-
1861
1855
  const isSameUrl = this.state.location.href === next.href
1862
1856
 
1863
- if (isSameUrl) {
1864
- nextAction = 'replace'
1857
+ // If the next urls are the same and we're not replacing,
1858
+ // do nothing
1859
+ if (isSameUrl && !next.replace) {
1860
+ return
1865
1861
  }
1866
1862
 
1867
1863
  let { maskedLocation, ...nextHistory } = next
@@ -1890,7 +1886,7 @@ export class Router<
1890
1886
  }
1891
1887
  }
1892
1888
 
1893
- this.history[nextAction === 'push' ? 'push' : 'replace'](
1889
+ this.history[next.replace ? 'replace' : 'push'](
1894
1890
  nextHistory.href,
1895
1891
  nextHistory.state,
1896
1892
  )