Commit b99ddaf
Summary:
New methods `Promise.try` and `Promise.withResolvers` were added to the Hermes V1 branch, see: facebook/hermes#2020
I tested them on the latest RN 0.86.0, and they are working:
```tsx
console.log({
'ReactNativeVersion.getVersionString()':ReactNativeVersion.getVersionString(),
'Promise.try': Promise.try,
'Promise.withResolvers': Promise.withResolvers,
});
//{
// "Promise.try": [Function anonymous],
// "Promise.withResolvers": [Function anonymous],
// "ReactNativeVersion.getVersionString()": "0.86.0"
// }
```
- `es2024.promise` - includes `Promise.withResolvers`
- `esnext.promise` - includes `Promise.try`
## Changelog:
[GENERAL] [ADDED] - Add `Promise.try` + `Promise.withResolvers` typescript types
Pull Request resolved: #57215
Test Plan:
```
edit `node_modules/react-native/typescript-config/tsconfig.json`
add `es2024.promise` `esnext.promise`
try to use new methods in ts files
// no error expected
```
Reviewed By: robhogan
Differential Revision: D108745447
Pulled By: fabriziocucci
fbshipit-source-id: dfebe404ab45bc4cb9071692d2f13c42b2816e51
1 parent 097dbc2 commit b99ddaf
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
0 commit comments