I want my code to send the variable from onChange to useState here's my code at for displaying my table on each row
const dataTableElements = entireListData
.slice(0, maxRow)
.map((entireListData, index) => {
var dotStatus = null;
if (entireListData.PriceStatus == true) {
dotStatus = <GreenDot>{entireListData.Price}</GreenDot>;
} else {
dotStatus = <RedDot>{entireListData.Price}</RedDot>;
}
return (
<Tr data-index={index}>
<Td>{entireListData.no}</Td>
<Td>{entireListData.BillNo}</Td>
<Td>{entireListData.Product}</Td>
<Td>
<StatusTableBox>{dotStatus}</StatusTableBox>
</Td>
</Tr>
);
});
next is my select tag
return (
<div>
<Tabbar />
<div>
<p>
Show
<select
value={entireListData.no}
onChange={() => {
sendCurrentRow(entireListData.no);
}}
>
{rowTableElement}
</select>
Entires
</p>
</div>
from the result of the above, it shows in console "undefined".