Skip to content

Commit b99ddaf

Browse files
retyuimeta-codesync[bot]
authored andcommitted
feat: [TypeScript] Add missing methods types Promise.try + Promise.withResolvers (#57215)
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

File tree

packages/typescript-config/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"es2022.array",
2020
"es2022.error",
2121
"es2022.object",
22-
"es2022.string"
22+
"es2022.string",
23+
"es2024.promise",
24+
"esnext.promise"
2325
],
2426
"allowJs": true,
2527
"jsx": "react-native",

0 commit comments

Comments
 (0)