Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!