Skip to content

DOESNT RE-RENDER - If children sizes change #74

@atumas-bananamilk

Description

@atumas-bananamilk

Description

Justified grid doesn't re-render items if their sizes change.

Steps to check or reproduce

I fetch multiple images but the initial grid stays, how do I re-render the grid to dynamically resize every item if they change?

My code:

...
const [images, setImages] = useState<any[]>([])

...

<JustifiedGrid
  gap={5}
  defaultDirection={"end"}
  align={'justify'}
  columnRange={[1,4]}
  rowRange={0}
  sizeRange={[100,500]}
  isCroppedSize={false}
  displayedRow={-1}
  useResizeObserver={true}
  observeChildren={true}
  autoResize={true}
>
  {images.map((x: any, index: number) => (
    <div key={index} className='w-full overflow-hidden'>
      <Image src={x?.url} alt='' className='' />
    </div>
  ))}
</JustifiedGrid>

Here's the result:

aaaa.mov

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions