Closed josueayala27 closed 18 hours ago
The Link
component was restricted to accept URLs with the pattern /${string}/
or /
, which excluded valid URLs containing hashes (#
) or other additional characters after the slash (/
).
For example, the URL "/components/calendar-range/#events"
was not accepted due to this restriction.
So the href
property type has been modified to accept any string starting with /
, removing the /${string}/
pattern restriction and thereby allowing more flexible and complete URLs.
It is now possible to use the Link component with URLs containing hashes:
<Link href="/components/calendar-range/#events">events</Link>
This change improves the flexibility of the Link component, allowing a wider range of valid URLs.
Ah I should have tested my suggestion first! I wanted the trailing slash to enforce at the type level some consistency in URLs, avoiding redirects from e.g. /page
to /page/
oh wow, good catch, not sure how i missed that. Or why i would have ever used an absolute link to localhost 🤔