Skip to content

Commit 2a97bdc

Browse files
authored
Refinements after React Router v7 migration (#902)
1 parent 7367c3d commit 2a97bdc

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

app/components/progress-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useNavigation } from 'react-router'
21
import { useEffect, useRef, useState } from 'react'
2+
import { useNavigation } from 'react-router'
33
import { useSpinDelay } from 'spin-delay'
44
import { cn } from '#app/utils/misc.tsx'
55
import { Icon } from './ui/icon.tsx'

app/root.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { wrapUseRoutesV7 } from '@sentry/react'
21
import { useRef } from 'react'
32
import {
43
data,
@@ -270,7 +269,7 @@ function AppWithProviders() {
270269
)
271270
}
272271

273-
export default wrapUseRoutesV7(AppWithProviders)
272+
export default AppWithProviders
274273

275274
function UserDropdown() {
276275
const user = useUser()

app/utils/client-hints.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
subscribeToSchemeChange,
99
} from '@epic-web/client-hints/color-scheme'
1010
import { clientHint as timeZoneHint } from '@epic-web/client-hints/time-zone'
11-
import { useRevalidator } from 'react-router'
1211
import * as React from 'react'
12+
import { useRevalidator } from 'react-router'
1313
import { useOptionalRequestInfo, useRequestInfo } from './request-info.ts'
1414

1515
const hintsUtils = getHintUtils({

app/utils/misc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { useFormAction, useNavigation } from 'react-router'
21
import { clsx, type ClassValue } from 'clsx'
32
import { useEffect, useMemo, useRef, useState } from 'react'
3+
import { useFormAction, useNavigation } from 'react-router'
44
import { useSpinDelay } from 'spin-delay'
55
import { extendTailwindMerge } from 'tailwind-merge'
66
import { extendedTheme } from './extended-theme.ts'

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ export default [
88
files: ['**/tests/**/*.ts'],
99
rules: { 'react-hooks/rules-of-hooks': 'off' },
1010
},
11+
{
12+
ignores: ['.react-router/*'],
13+
},
1114
]

react-router.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ import { type Config } from '@react-router/dev/config'
22
export default {
33
// Defaults to true. Set to false to enable SPA for all routes.
44
ssr: true,
5+
6+
future: {
7+
unstable_optimizeDeps: true,
8+
},
59
} satisfies Config

0 commit comments

Comments
 (0)