motion icon indicating copy to clipboard operation
motion copied to clipboard

[DOCS] Parameter error for useInView root example

Open Debbl opened this issue 1 year ago • 0 comments

Describe the bug

Parameter error for useInView root example

https://www.framer.com/motion/use-in-view/###root

the root should be at second parameter

function Carousel() {
  const container = useRef(null)
  const ref = useRef(null)
-  const isInView = useInView({ root: container })
+  const isInView = useInView(ref, { root: container })

  return (
    <div ref={container} style={{ overflow: "scroll" }}>
      <div ref={ref} />
    </div>
  )
}
image

The margin is also.

https://www.framer.com/motion/use-in-view/###margin

image

Debbl avatar Oct 23 '24 08:10 Debbl