We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7964978 commit 9faa4c1Copy full SHA for 9faa4c1
src/stories/helpers/use-current-width.ts
@@ -1,7 +1,7 @@
1
import { useEffect, useRef, useState } from 'react'
2
3
const useCurrentWidth = <ElementType extends HTMLElement>() => {
4
- const ref = useRef({ clientWidth: 0 } as ElementType)
+ const ref = useRef<ElementType>({ clientWidth: 0 } as any)
5
const [width, setWidth] = useState(0)
6
7
useEffect(() => {
0 commit comments