Skip to content
Source
Sign inSign up
TanStack/router

fix: memory leaks #5896

Mergedschiller-manuel(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/5896/headmerged by schiller-manuel(GitHub profile, opens in a new tab)

Showing 10 changed files with 6 additions and 12 deletions (loading 7).

x
0 of 10 viewed, 10 left
3 additions and 1 deletione2e/react-start/basic/src/routes/users.$userId.tsxModified
View file
@@ -1,5 +1,6 @@
import { ErrorComponent, createFileRoute } from '@tanstack/react-router'
import axios from 'redaxios'
+import { getRouterInstance } from '@tanstack/react-start'
import type { ErrorComponentProps } from '@tanstack/react-router'
​
import type { User } from '~/utils/users'
@@ -7,8 +8,9 @@
​
export const Route = createFileRoute('/users/$userId')({
loader: async ({ params: { userId } }) => {
+ const router = await getRouterInstance()
return await axios
- .get<User>('/api/users/' + userId)
+ .get<User>('/api/users/' + userId, { baseURL: router.options.origin })
.then((r) => r.data)
.catch(() => {
throw new Error('Failed to fetch user')
3 additions and 1 deletione2e/react-start/basic/src/routes/users.tsxModified
View file
@@ -1,12 +1,14 @@
import { Link, Outlet, createFileRoute } from '@tanstack/react-router'
+import { getRouterInstance } from '@tanstack/react-start'