naver / egjs-flicking

🎠 ♻️ Everyday 30 million people experience. It's reliable, flexible and extendable carousel.
https://naver.github.io/egjs-flicking/
MIT License
2.78k stars 129 forks source link

[React] cannot access the ref of the panel directly #879

Closed panda0603 closed 3 months ago

panda0603 commented 3 months ago

Description

Hi, I am trying to get the ref of the panel in React. However, the ref doesn't seem to exist. Here is the following sample code of a child panel:

   const panel1Ref = useRef()
   console.log(panel1Ref.current) // undefined

   ...

   <Flicking
      align="prev"
   >
      <div ref={panel1Ref}>panel 1</div>
      <div>panel 2</div>
   </Flicking>

However with the same code, if I turn useFindDomNode to true for Flicking option, I'm able to access the ref of panel1. Is this intentional or a bug?

If it is intentional, how may I access the ref of the panel?

Thanks