Skip to content

Commit b6a66c7

Browse files
authored
[dev-overlay] Fix ref warning when Pages Router with React 18 is used (#77726)
1 parent 9249188 commit b6a66c7

File tree

1 file changed

+19
-18
lines changed
  • packages/next/src/client/components/react-dev-overlay/ui/components/fader

1 file changed

+19
-18
lines changed

packages/next/src/client/components/react-dev-overlay/ui/components/fader/index.tsx

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
import type { CSSProperties } from 'react'
1+
import { type CSSProperties, type Ref, forwardRef } from 'react'
22

3-
export function Fader({
4-
stop,
5-
blur,
6-
side,
7-
style,
8-
height,
9-
ref,
10-
}: {
11-
stop?: string
12-
blur?: string
13-
height?: number
14-
side: 'top' | 'bottom' | 'left' | 'right'
15-
className?: string
16-
style?: CSSProperties
17-
ref?: React.Ref<HTMLDivElement>
18-
}) {
3+
export const Fader = forwardRef(function Fader(
4+
{
5+
stop,
6+
blur,
7+
side,
8+
style,
9+
height,
10+
}: {
11+
stop?: string
12+
blur?: string
13+
height?: number
14+
side: 'top' | 'bottom' | 'left' | 'right'
15+
className?: string
16+
style?: CSSProperties
17+
},
18+
ref: Ref<HTMLDivElement>
19+
) {
1920
return (
2021
<div
2122
ref={ref}
@@ -33,7 +34,7 @@ export function Fader({
3334
}
3435
/>
3536
)
36-
}
37+
})
3738

3839
export const FADER_STYLES = `
3940
.nextjs-scroll-fader {

0 commit comments

Comments
 (0)