Closed intergalacticspacehighway closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
solito-s9oj | ✅ Ready (Inspect) | Visit Preview | Dec 9, 2022 at 6:50AM (UTC) |
with-custom-fonts | ✅ Ready (Inspect) | Visit Preview | Dec 9, 2022 at 6:50AM (UTC) |
My only question here is how we're detecting an external link. Is there a way to know how browsers do it? Is startsWith('/')
correct?
For example, if you accidentally start with artists/drake
, what should we do?
if you accidentally start with artists/drake, what should we do?
yeah, I thought about it. Apparently, React Navigation requires path to start with /
, or else it throws an error. I missed adding it in the description. Do you think it can still break?
yeah but it will never error in this case because we don't forward the URL down. I'm wondering how the URL should be detected...
Should we check if it includes ://
? This would allow http*://
as well as app deep links like beatgig://
.
If we only match local requests for /*
, then an empty ""
string would not error from React Navigation (as it should) and will instead open a web browser on native. Meanwhile, an empty string would do nothing on Web.
There are edge cases, but just want to make sure we account for them properly to match expected behavior.
Makes sense. I just took a look at how Next handles it. I think we could use the isAbsoluteUrl. It's doing a simple regex test to detect if URL is absolute which would make sense for external URLs. wdyt?
I think that makes sense!
@nandorojo updated. Not sure why it's ignoring 2 deployments 🤔
Left some final minor comments then this looks good to me!
Issue
NextJS's
Link
component works with external URLs. So, I think it makes sense to handle it on native as well.