Skip to content

Commit 1622e20

Browse files
nissy-devfacebook-github-bot
authored andcommitted
Turn Flow strict mode on for KeyBoard (facebook#22114)
Summary: Related to facebook#22100 Turn Flow strict mode on for KeyBoard - [x] npm run prettier - [ ] npm run flow-check-ios - [ ] npm run flow-check-android This error was happend facebook#22101 facebook#22048 [GENERAL] [ENHANCEMENT] [Components/Keyboard/Keyboard.js] - Flow strict mode Pull Request resolved: facebook#22114 Differential Revision: D12920947 Pulled By: TheSavior fbshipit-source-id: 8d72019efd4d30032ce4784764e5deb9c60e7b01
1 parent 33d5b52 commit 1622e20

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Libraries/Components/Keyboard/Keyboard.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*
77
* @format
8-
* @flow
8+
* @flow strict-local
99
*/
1010

1111
'use strict';
@@ -121,7 +121,10 @@ let Keyboard = {
121121
* @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for.
122122
* @param {function} callback function to be called when the event fires.
123123
*/
124-
removeListener(eventName: KeyboardEventName, callback: Function) {
124+
removeListener(
125+
eventName: KeyboardEventName,
126+
callback: KeyboardEventListener,
127+
) {
125128
invariant(false, 'Dummy method used for documentation');
126129
},
127130

@@ -155,12 +158,12 @@ Keyboard = KeyboardEventEmitter;
155158
Keyboard.dismiss = dismissKeyboard;
156159
Keyboard.scheduleLayoutAnimation = function(event: KeyboardEvent) {
157160
const {duration, easing} = event;
158-
if (duration) {
161+
if (duration != null && duration !== 0) {
159162
LayoutAnimation.configureNext({
160163
duration: duration,
161164
update: {
162165
duration: duration,
163-
type: (easing && LayoutAnimation.Types[easing]) || 'keyboard',
166+
type: (easing != null && LayoutAnimation.Types[easing]) || 'keyboard',
164167
},
165168
});
166169
}

0 commit comments

Comments
 (0)