1.1. Describe a shipment with types
Three shipments, and nobody can tell which one is urgent. Let's give each one a priority.
In /shipments.ts, the Shipment interface describes what every record holds. Add the new field in place of the TODO:
priority: 'standard' | 'express';
Give S-101 priority: 'express' and the other two priority: 'standard'. Then show it in /App.tsx, in place of the TODO in the list item:
<span> · {shipment.priority}</span>
One thing to know before you try: like Vite, this preview removes the types without checking them, and the editor here doesn't check them either. VS Code and pnpm build do, and you'll see that in 2.1.
Need a hint?
- The field is required, so every record in the array needs a priority.
- Inside the list item, shipment is the current record: {shipment.priority}.
When S-101 shows express, misspell it as 'expres'. The preview shows the typo without complaint.