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

119
Views
Dynamic Event Handling React JS

I am using 2 different functions to do the same thing and I am trying to merge them into one, but I am unable to do so. I read such a thing can be achieved through Dynamic Event Handling. I have tried but I failed.

Below are the two functions I want to merge

 updateProfValue(index, value) {
    this.props.profValue(index, value);
  }

 updatePersonalVaue(index, value) {
    this.props.persValue(index, value);
  }

And I want them to use in this component dynamically.

{
  abc.map((item, index) => { <
    FCW
    changeHandler = {
      this.updatePersonalVaue
    }
    defaultOption = {
      item.value
    }
    index = {
      index
    }
    key = {
      item.Cn
    }
    name = {
      item.dN
    }
    required = {
      item.r
    }
    />);
  })
}

{
  xyz.map((item, index) => { <
        FCW
        changeHandler = {
          this.updateProfVaue
        }
        defaultOption = {
          item.value
        }
        index = {
          index
        }
        key = {
          item.Cn
        }
        name = {
          item.dN
        }
        required = {
          item.r
        }
        />);

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!