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

150
Views
React useEffect, only call after a state change

We are using react recollect as state management tool. In this useEffect below, I want to call appStore.getSettingsHistory() function only if the states in array dependency does change. But based on the below code, when component mounts, we see 5 calls (as many as in array) initially, then other calls as those state change. How can I achieve, calling this api (appStore.getSettingsHistory()) only once in the beginning, then as these states change.

useEffect(() => {
  appStore.getSettingsHistory();
}, [store.brandPrefs, store.formularies, store.selectedFormularyName, store.settings.showMaskToPatient, store.settings.sendMessageOnComplete])
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This happens when you are using the strict mode

about 4 years ago · Juan Pablo Isaza Report
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!