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?