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

131
Vistas
React Native useMemo in simple calculations

So I have read that you should not use useMemo hook for simple (or not expensive) calculations. I have this following example were I check whether the application is Loading or Refreshing using useMemo hook. I use this constant in many places on my render to disable buttons until the current screen does not finish loading.

  const isLoadingOrRefreshing = useMemo(() => isLoading || isRefreshing, [
    isLoading,
    isRefreshing,
  ]);

What is the best approach here? For me, it does not feel right putting "isLoading || isRefreshing" multiple times in my render. I also though on using useEffect with those dependencies and then use setIsLoadingOrRefreshing inside it.

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