From 306c8d64d91f87b248f627333de7f24355248088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Osadnik?= Date: Mon, 5 Aug 2019 02:31:28 -0700 Subject: [PATCH] Back out "[react-native][PR] Allow Animation EndResult callback to return Promise" Summary: Original commit changeset: 420d29d262b6 Reverts https://github.com/facebook/react-native/pull/25793 / D16515465 Union type property is not supported by codegen. We don't want to support unions yet and because the improvement is not that big and not yet published as stable for OSS (neither used anywhere internally) we can safely revert it. Reviewed By: RSNara Differential Revision: D16621228 fbshipit-source-id: 2fa416eef1ae353990860026ca97d2b0b429a852 --- Libraries/Animated/src/NativeAnimatedModule.js | 2 +- Libraries/Animated/src/animations/Animation.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Animated/src/NativeAnimatedModule.js b/Libraries/Animated/src/NativeAnimatedModule.js index 23d738bbffc..80ece9d69d0 100644 --- a/Libraries/Animated/src/NativeAnimatedModule.js +++ b/Libraries/Animated/src/NativeAnimatedModule.js @@ -14,7 +14,7 @@ import type {TurboModule} from '../../TurboModule/RCTExport'; import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry'; type EndResult = {finished: boolean}; -type EndCallback = (result: EndResult) => void | Promise; +type EndCallback = (result: EndResult) => void; export type EventMapping = {| nativeEventPath: Array, diff --git a/Libraries/Animated/src/animations/Animation.js b/Libraries/Animated/src/animations/Animation.js index d8a82ed502a..cb175e1ecbf 100644 --- a/Libraries/Animated/src/animations/Animation.js +++ b/Libraries/Animated/src/animations/Animation.js @@ -14,7 +14,7 @@ const NativeAnimatedHelper = require('../NativeAnimatedHelper'); import type AnimatedValue from '../nodes/AnimatedValue'; export type EndResult = {finished: boolean}; -export type EndCallback = (result: EndResult) => void | Promise; +export type EndCallback = (result: EndResult) => void; export type AnimationConfig = { isInteraction?: boolean,