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

149
Vistas
How to unmount screens in React Navigation?

My app consists of 2 Tab Navigators and a Drawer Navigator and a Stack Navigator, I want to unmount every screen if it's not open. Since I have many navigators, things got a bit complex. I found this solution on a blog online, can it be applicable and efficient with all the screens in each navigator?

import React, { useState, useCallback } from 'react'
import { useFocusEffect } from '@react-navigation/native'

export default function Live() {
  const [isVisible, setIsVisible] = useState(false)

  useFocusEffect(
    useCallback(() => {
      setIsVisible(true)

      return () => {
        setIsVisible(false)
      }
    }, [])
  )

  return (
    <>
      {isVisible && 
        <>
          {/* Your component goes here */}
        </>
      }
    </>
  )
}
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