Skip to content

Commit

Permalink
update type definitions for unstable_batchedUpdates (#36180)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
k-yle authored and facebook-github-bot committed Mar 1, 2023
1 parent 32931b7 commit 71157f6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions types/public/ReactNativeRenderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,5 @@ export interface GestureResponderHandlers {
/**
* React Native also implements unstable_batchedUpdates
*/
export function unstable_batchedUpdates<A, B>(
callback: (a: A, b: B) => any,
a: A,
b: B,
): void;
export function unstable_batchedUpdates<A>(callback: (a: A) => any, a: A): void;
export function unstable_batchedUpdates(callback: () => any): void;
export function unstable_batchedUpdates<A, R>(callback: (a: A) => R, a: A): R;
export function unstable_batchedUpdates<R>(callback: () => R): R;

0 comments on commit 71157f6

Please sign in to comment.