2016-03-25 06:40:52 +08:00
|
|
|
/**
|
2022-10-18 23:19:24 +08:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2016-03-25 06:40:52 +08:00
|
|
|
*
|
2017-09-25 04:48:13 +08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-01-23 01:58:35 +08:00
|
|
|
*
|
|
|
|
|
* @flow
|
2016-03-25 06:40:52 +08:00
|
|
|
*/
|
|
|
|
|
|
2017-10-25 07:55:00 +08:00
|
|
|
// Module provided by RN:
|
2019-05-23 15:23:54 +08:00
|
|
|
import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
|
2016-03-25 06:40:52 +08:00
|
|
|
|
2017-12-01 05:39:39 +08:00
|
|
|
const ReactNativeGlobalResponderHandler = {
|
2023-01-31 21:25:05 +08:00
|
|
|
onChange: function (from: any, to: any, blockNativeResponder: boolean) {
|
2016-03-25 06:40:52 +08:00
|
|
|
if (to !== null) {
|
2017-12-01 05:39:39 +08:00
|
|
|
const tag = to.stateNode._nativeTag;
|
2017-02-22 06:41:09 +08:00
|
|
|
UIManager.setJSResponder(tag, blockNativeResponder);
|
2016-03-25 06:40:52 +08:00
|
|
|
} else {
|
|
|
|
|
UIManager.clearJSResponder();
|
|
|
|
|
}
|
2016-04-19 07:11:31 +08:00
|
|
|
},
|
2016-03-25 06:40:52 +08:00
|
|
|
};
|
|
|
|
|
|
2017-11-03 03:50:03 +08:00
|
|
|
export default ReactNativeGlobalResponderHandler;
|