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

205
Vistas
How to get the DOM element of an `observer` wrapped component?

I have defined my JSX components like this:

const ComponentA = observer(({state}) => {return <div></div>})

I am using observer from mobx: https://mobx.js.org/react-integration.html

I need to see what the rendered height is of the div by using the browser API for the DOM node. It will differ based on the contents it contains.

How do I do that?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I'm sorry, I don't really understand what you're trying to get at. Perhaps this will help?

const divRef = useRef();

useEffect(() => {
  console.log(divRef.current.clientHeight);
}, []);

return <div ref={divRef}></div>
about 4 years ago · Santiago Trujillo 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