Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
Why is this layout animation not working?

The animation that I tried to replicate

timestamp for the code: 34:15-34:45

timestamp for the animation demonstration: 34:47-34:54

It is easier to visualize through the link, but bascially the filtered items move to the destination instead of simply filtering

css properties used in the video

.popularMovie{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr));
  grid-column-gap: 1rem;
  grid-row-gap: 2rem;
}

The animation in the video basically just used only 2 motion.div with 2 layout attribute, the css used is also copied but the effect is not reproducable below is a code sandbox example that I made,

Minimal reproducible example

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The answer is:

  1. Do not miss the key property of the inner component:

<motion.div key={item.id} layout className="box">

  1. Make sure that key property is unique (e.g. DO NOT use something like filtered.map((item, i) => <h2 key={i}/>))
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda