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

240
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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