I need to link shipment numbers to the driver and display the data in the table
- Note that I am using json server
Table
I need to link shipment numbers to the driver and display the data in the table
Table
You need to JSON.parse
the ShippmentNumber. Then map over the array of numbers and wrap them with <a>
tags.
Just an example we can replace the line <td>{shippment.ShippmentNumber}</td>
with
<td>
{JSON.parse(shippment.ShippmentNumber).map(number => {
return <a key={number} href={`<shipment-path>/${number}`}>{number}</a>
})}
</td>