Skip to content

Commit 71157f6

Browse files
k-ylefacebook-github-bot
authored andcommittedMar 1, 2023
update type definitions for unstable_batchedUpdates (#36180)
Summary: This PR fixes the type definitions for `unstable_batchedUpdates`. The same change was recently made on DefinitelyTyped - see DefinitelyTyped/DefinitelyTyped#63517 for a more detailed explanation ## Changelog [General] [Fixed] - fix type definition for `unstable_batchedUpdates` Pull Request resolved: #36180 Test Plan: Note how the typescript defintions now match [the flow definitions](https://github.com/facebook/react-native/blob/43636267011a97490ed7495b08e500c5d0d54872/Libraries/ReactNative/RendererImplementation.js#L99), and note how [the tests in DefinitelyTyped](https://github.com/k-yle/DefinitelyTyped/blob/a4e15e3c2b9c6d689918cbbfa98c02cd26fe7681/types/react-dom/test/react-dom-tests.tsx#L231-L238) are passing. Reviewed By: christophpurrer, cortinico Differential Revision: D43367314 Pulled By: lunaleaps fbshipit-source-id: 74351daaf2c00a372f4e28992d41ebd2cbb1c7cc
1 parent 32931b7 commit 71157f6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed
 

‎types/public/ReactNativeRenderer.d.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,5 @@ export interface GestureResponderHandlers {
140140
/**
141141
* React Native also implements unstable_batchedUpdates
142142
*/
143-
export function unstable_batchedUpdates<A, B>(
144-
callback: (a: A, b: B) => any,
145-
a: A,
146-
b: B,
147-
): void;
148-
export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
149-
export function unstable_batchedUpdates(callback: () => any): void;
143+
export function unstable_batchedUpdates<A, R>(callback: (a: A) => R, a: A): R;
144+
export function unstable_batchedUpdates<R>(callback: () => R): R;

0 commit comments

Comments
 (0)
Please sign in to comment.