In react router, I am going through the tutorial but trying to use typescript and have this code
let params = useParams();
let id:string = params.invoiceId
let invoice = getInvoice(parseInt(id, 10));
The second line has an error
TS2322: Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'
How do I do this properly to lookup and display the invoice? Also, how to reroute to the catch all * if the string is not an integer.
thanks, Dean