diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 000000000..b6a445318 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,25 @@ +declare module 'react-dom' { + export function unstable_batchedUpdates( + callback: (a: A, b: B) => any, + a: A, + b: B + ): void + export function unstable_batchedUpdates( + callback: (a: A) => any, + a: A + ): void + export function unstable_batchedUpdates(callback: () => any): void +} + +declare module 'react-native' { + export function unstable_batchedUpdates( + callback: (a: A, b: B) => any, + a: A, + b: B + ): void + export function unstable_batchedUpdates( + callback: (a: A) => any, + a: A + ): void + export function unstable_batchedUpdates(callback: () => any): void +} diff --git a/src/utils/reactBatchedUpdates.native.js b/src/utils/reactBatchedUpdates.native.ts similarity index 72% rename from src/utils/reactBatchedUpdates.native.js rename to src/utils/reactBatchedUpdates.native.ts index 9fec5549a..edb635d2d 100644 --- a/src/utils/reactBatchedUpdates.native.js +++ b/src/utils/reactBatchedUpdates.native.ts @@ -1,4 +1,3 @@ -/* eslint-disable import/named */ import { unstable_batchedUpdates } from 'react-native' export { unstable_batchedUpdates } diff --git a/src/utils/reactBatchedUpdates.js b/src/utils/reactBatchedUpdates.ts similarity index 55% rename from src/utils/reactBatchedUpdates.js rename to src/utils/reactBatchedUpdates.ts index 2a66a4428..0fca6d85e 100644 --- a/src/utils/reactBatchedUpdates.js +++ b/src/utils/reactBatchedUpdates.ts @@ -1,2 +1 @@ -/* eslint-disable import/no-unresolved */ export { unstable_batchedUpdates } from 'react-dom'