Skip to content

Commit

Permalink
fix(docs): wrong syntax for arrow function in useScroll example II
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianFigueredo authored and heyitsarpit committed Jan 12, 2024
1 parent 9b32e6f commit 2e36401
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/useScroll/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export function Demo() {
const box = useRef<HTMLDivElement | null>(null)
const scrollProgress = useRef<HTMLDivElement | null>(null)

useScroll(box, ({ scrollX }) =>
if(!scrollProgress.current) return
useScroll(box, ({ scrollX }) => {
if(!scrollProgress.current) return

scrollProgress.current.style.width = `${scrollX * 100}%`
)
scrollProgress.current.style.width = `${scrollX * 100}%`
})

return (
<div ref={box}>
Expand Down

0 comments on commit 2e36401

Please sign in to comment.