as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

URL

The global URL class implements the URL Web API, supporting all standard properties: hash, host, hostname, href, origin, password, pathname, port, protocol, search, searchParams, and username.

Trailing slash bug fix

Vega's URL implementation includes a fix for a known React Native issue #24428 where URLs incorrectly received automatic trailing slashes. For example, in stock React Native, a URL like [https://example.com](https://example.com) was incorrectly converted to [https://example.com/,](https://example.com/,) potentially causing 404 errors or unexpected behavior.

This issue has been resolved in React Native for Vega, so developers can use the URL class without needing third-party polyfills such as react-native-url-polyfill.

Example

This example demonstrates the fixed trailing slash issue.

Copied to clipboard.


const url = new URL('https://example.com/path/to/resource.png');
console.log(url.href); // Correctly outputs: https://example.com/path/to/resource.png


Last updated: May 13, 2026