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

241
Vistas
Unable to dimiss a modal (react-native-date-picker)

So we are using this lib react-native-date-picker for date picking (obviously).

When user is timeout from app, we are navigating the user back to login screen. However if the date picker (this is a modal) is opened, it will remain on top of screen as always. Within the library I see no option to decide when the modal should stay visible/invisible.

Here's few approaches I've tried with no success

  1. Using forwardRef wrapping my child component (which shows the date picker), trying to access the component via Ref. No success, always receive NULL in return. I think the library don't support this either?

  2. Based on the timeout props we stored in Redux, within the function componentdidupdate we setState to re-render the screen by telling DatePicker's prop open as FALSE. No success either.

Im curious on the reason behind why is this happening. What are the possible solution?

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

0

react-native-date-picker uses the corresponding Date picker native module for each platform. When the native modal is opened, it runs on the Native thread while your code runs on the JavaScript thread.

When the user session expired and the app navigates to Login Screen, React Navigation tries to unmount the current screen component but Date Picker is not mounted because it runs on Native Thread.

Your app logic should detect if the modal is opened before and close it before navigating to Login screen

about 4 years ago · Santiago Gelvez 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