Turn Flow strict mode on for KeyBoard (#22114)
Summary: Related to #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 #22101 #22048 [GENERAL] [ENHANCEMENT] [Components/Keyboard/Keyboard.js] - Flow strict mode Pull Request resolved: https://github.com/facebook/react-native/pull/22114 Differential Revision: D12920947 Pulled By: TheSavior fbshipit-source-id: 8d72019efd4d30032ce4784764e5deb9c60e7b01
This commit is contained in:
parent
3c0211b61a
commit
fbc5a4f5e6
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*
|
*
|
||||||
* @format
|
* @format
|
||||||
* @flow
|
* @flow strict-local
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
@ -121,7 +121,10 @@ let Keyboard = {
|
||||||
* @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for.
|
* @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for.
|
||||||
* @param {function} callback function to be called when the event fires.
|
* @param {function} callback function to be called when the event fires.
|
||||||
*/
|
*/
|
||||||
removeListener(eventName: KeyboardEventName, callback: Function) {
|
removeListener(
|
||||||
|
eventName: KeyboardEventName,
|
||||||
|
callback: KeyboardEventListener,
|
||||||
|
) {
|
||||||
invariant(false, 'Dummy method used for documentation');
|
invariant(false, 'Dummy method used for documentation');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -155,12 +158,12 @@ Keyboard = KeyboardEventEmitter;
|
||||||
Keyboard.dismiss = dismissKeyboard;
|
Keyboard.dismiss = dismissKeyboard;
|
||||||
Keyboard.scheduleLayoutAnimation = function(event: KeyboardEvent) {
|
Keyboard.scheduleLayoutAnimation = function(event: KeyboardEvent) {
|
||||||
const {duration, easing} = event;
|
const {duration, easing} = event;
|
||||||
if (duration) {
|
if (duration != null && duration !== 0) {
|
||||||
LayoutAnimation.configureNext({
|
LayoutAnimation.configureNext({
|
||||||
duration: duration,
|
duration: duration,
|
||||||
update: {
|
update: {
|
||||||
duration: duration,
|
duration: duration,
|
||||||
type: (easing && LayoutAnimation.Types[easing]) || 'keyboard',
|
type: (easing != null && LayoutAnimation.Types[easing]) || 'keyboard',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue