Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
Can't get property container ref element - React-spring v9. ParallaxLayers. useRef

When i want add event scroll to track its position on the page, i used useRef and almost everything worked, except for the smoothness of the scrollToTop event, but that's not about it now. Then I got the value of useRef as an object indicating what kind of object it was and could manipulate it (I needed to get the value of ref.current.container)

I was getting this:

console.log(ref)
console.log(ref.current.container) console.log(ref)
console.log(ref.current.container)

At that time I used react-spring@8.0.27 with that dependency
import { Parallax, ParallaxLayer } from 'react-spring/renderprops-addons'

But when i needed add sticky container it's not worked And I had to turn to the example from the react-spring documentation

There I encountered other dependencies
import { Parallax, ParallaxLayer } from '@react-spring/parallax'
With which the sticky container worked, but the opportunity to get the correct ref was broken

I was getting this: object itself disappeared and became impersonal

enter image description here console.log(ref)
console.log(ref.current.container)

Question: How do I get the correct ref in this case?

Thank's for any help!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda