mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary:
```tsx
// Hermes runtime (RN 73.x)
console.log({...Headers.prototype})
// result:
{
"append": [Function anonymous],
"delete": [Function anonymous],
"entries": [Function anonymous],
"forEach": [Function anonymous],
"get": [Function anonymous],
"has": [Function anonymous],
"keys": [Function anonymous],
"set": [Function anonymous],
"values": [Function anonymous],
Symbol(Symbol.iterator): [Function anonymous]
}
```
But in typescript
```tsx
new Headers().entries()
// ^^^ Error: Property entries does not exist on type Headers
Object.fromEntries(new Headers())
// ^^^ Error: Property [Symbol.iterator] is missing in type Headers but required in type Iterable<readonly any[]>
```
## Changelog:
[GENERAL] [ADDED] - [TypeScript] Add missing `Header` methods
Pull Request resolved: https://github.com/facebook/react-native/pull/43279
Test Plan: Use code above in your RN project and run `yarn tsc --noEmit`
Reviewed By: rshest
Differential Revision: D54554523
Pulled By: arushikesarwani94
fbshipit-source-id: ae7f05f9526771ff003aaf22f786b5503661c739