naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
1.92k stars 91 forks source link

Is it possible to receive a ReactNode in container that is a props of a MasonryInfiniteGrid component? #565

Open dngwoodo opened 4 months ago

dngwoodo commented 4 months ago

Description

en I want to apply AnimatePresence to Framer, is there any way to do this in MasonryInfiniteGrid? The code is roughly like below. I can't seem to get a ReactNode even if I use container, containerTag, so it's currently impossible to process.

ko Framer 에 AnimatePresence 을 적용시키고 싶은데 MasonryInfiniteGrid 에서 처리할 수 있는 방법이 있을까요? 코드는 대략 아래와 같습니다. container, containerTag 를 사용해도 ReactNode 를 받을 수 없어 현재 처리가 불가능해보입니다.

      <MasonryInfiniteGrid
        align="center"
        gap={10}
        useResizeObserver
        observeChildren
      >
        <AnimatePresence> // <- 불가능
          {feeds.map((feed) => (
            <FeedItem feed={feed} key={feed.id} />
          ))}
        </AnimatePresence>
      </MasonryInfiniteGrid>

Steps to check or reproduce

daybrush commented 1 month ago

안녕하세요.

containerTag={AnimatePresence} 또는 scrollContainer={elementRef} 방식으로 사용할 수 있을 것 같습니다.

<AnimatePresence ref={ref}>
    <MasonryInfiniteGrid scrollContainer={ref}>
         {feeds}
    </MasonryInfiniteGrid>
</AnimatePresence>