Elements are redrawn during layout rows #128
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
This is how this library actually works. For a given set of input parameters (photos, spacing, container width, etc.) it produces a single optimal layout, and recalculates it every time the input parameters change. So whenever you add photos to the
I'm sure the issue that you are facing is pretty clear in your head, but you are not articulating it clearly. Please see if you can describe the problem that you are facing.
The reason why each row of photos is wrapped in a renderRowContainer={({ children }) => <>{children}</> } |
Beta Was this translation helpful? Give feedback.
-
FYI, the upcoming release v3 contains an experimental |
Beta Was this translation helpful? Give feedback.
Please see my comment above - it explains the effect you are seeing.
If you are trying to build an infinite scroll, you can take a look at the following example - https://codesandbox.io/s/react-photo-album-90-fs95ss?file=/src/App.tsx
You can render each batch of photos in separate
<PhotoAlbum>
element, and this would prevent the layout shift.