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
AnimatePresence + react-intersection-observer animation conflict

I'm using Framer Motion and react-intersection-observer in a React App to achieve the following result:

I'm creating a page that is divided into two section, I have a button on top to switch from a section to the other with a "slide-in" animation (on x property) controlled by <AnimatePresence />.

Now, in the second section there's a list of elements and I want to create the classical "fade-in" animation (on opacity) as each element enters the viewport. I managed to achieve that with react-intersection-observer successfully.

Problem is, I want to prevent the opacity animation for the first 1 or 2 elements that would already be in the viewport if it would be a single page (if it make sense), because the opacity animation overlaps with the slide animation.

Here's a simplified snippet of code that reproduces what I've done. (I know i sould be using the integrated snippet editor but it doesn't support external libraries)

To be clear: I don't want the animation on the opacity of the Comp component to interfere with the slide in animation generated by AnimatePresence.

I already tried adding rootMargin to the useView() options and i also tried using the useisPresent() hook from AnimatePresence but both methods didn't work.

Any solution? thanks in advance.

about 4 years ago · Juan Pablo Isaza
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