How do I handle phone numbers with NextJS Links?

Viewed 1612

I have a Link component that uses Next/Link and I'm passing in a telephone number formatted like this: tel:+15555555555

However I get an error:

Invalid href passed to router: tel:+15555555555

Are telephone numbers not supported?

1 Answers

Next/Link is a component for page navigation. There is no good reason to use it with special links such as tel: / mailto:. Use regular a element

<a href={`tel:${phone}`}>tel</a>
Related