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

161
Views
How to return 2 function calls in the arrow function at once?

Is there way to return 2 items in the same return of the arrow function?

useEffect(() => {
        return () =>
            removeEventListener('scroll', handleScroll) and setName('');
    }, []);

Please don't offer using useEffect twice

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

This should help

useEffect(() => {
   return () => {
     removeEventListener('scroll', handleScroll);
     setName('');
 }           
}, []);
about 4 years ago · Juan Pablo Isaza Report

0

just change your code to this:

useEffect(() => {
        return () => {
            removeEventListener('scroll', handleScroll);
            setName('');
        }
    }, []);

But setting state on unMount is not suggested

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!