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

138
Views
Get id of my row table and pass as parameter to another component

Im trying to get the id from a row of my table and pass it as parameter to my component <ModalExcluirAluno />, but it return undefined.

var usu;

{
        Header: 'Action',
            accessor: 'action',
            Cell: row => (
            <div onClick={() => adicionarValor(row.row.original.id)} >
               <ModalExcluirAluno value={usu} />
            </div>
        ),
},

function adicionarValor(id) {
    usu = id;
    console.log(usu)
}

In my console it return the id normaly, but to my function it gave me "undefined", I know thats why my function dont change the variable value, even so, i want to pass to the id value of the row clicked to my component, what can i do?

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!