-
Notifications
You must be signed in to change notification settings - Fork 25k
Open
Labels
Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.This issue can be reproduced in Snack or an attached project.Resolution: PR SubmittedA pull request with a fix has been provided.A pull request with a fix has been provided.
Description
Description
The current URL and URLSearchParams type definitions in globals.d.ts are missing several standard properties and methods that are present in the Web API and supported by the React Native runtime (via whatwg-url polyfill).
For URL, properties like hash, host, hostname, href, origin, password, pathname, port, protocol, search, username are missing.
For URLSearchParams, methods like delete, get, getAll, has, set, sort, forEach, keys, values, entries are missing.
Steps to reproduce
- Create a new React Native project with TypeScript.
- Try to access
new URL('https://example.com').pathname. - Try to use
new URLSearchParams().get('key'). - Observe TypeScript errors:
Property 'pathname' does not exist on type 'URL'andProperty 'get' does not exist on type 'URLSearchParams'.
React Native Version
0.82.0
Affected Platforms
Runtime - Android, Runtime - iOS
Output of npx @react-native-community/cli info
N/A - Static Analysis Issue (Type Definition Bug)
Stacktrace or Logs
Property 'pathname' does not exist on type 'URL'.
Property 'get' does not exist on type 'URLSearchParams'.
MANDATORY Reproducer
https://snack.expo.dev/@manishbalayan/intelligent-indigo-apples?platform=ios
Screenshots and Videos
There is the error shown in ScreenshotMetadata
Metadata
Assignees
Labels
Issue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.This issue can be reproduced in Snack or an attached project.Resolution: PR SubmittedA pull request with a fix has been provided.A pull request with a fix has been provided.