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

169
Vistas
React: how to monitor the focus state of another component

I have 2 separate components that are very "far" from each other (no parent-child relationship to pass props around):

  1. A component that does a count-down and navigates away when timer is hit.
  2. A text field down below the page.

I want to stop the timer when the user is editing the text field.

Besides saving an "isEditing" state into Redux or window (or some state management) from component #2, and monitoring that state from component #1, are there any standard React way to achieve this?

Perhaps there is a way for a ref to listen to another ref's property change, such as focus?

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