-
Notifications
You must be signed in to change notification settings - Fork 46.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setJSResponder in Fabric renderer (#13031)
- Loading branch information
1 parent
051637d
commit bc963f3
Showing
4 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
packages/react-native-renderer/src/ReactFabricGlobalResponderHandler.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @flow | ||
*/ | ||
|
||
// Module provided by RN: | ||
import UIManager from 'UIManager'; | ||
|
||
const ReactFabricGlobalResponderHandler = { | ||
onChange: function(from: any, to: any, blockNativeResponder: boolean) { | ||
if (to !== null) { | ||
const tag = to.stateNode.canonical._nativeTag; | ||
UIManager.setJSResponder(tag, blockNativeResponder); | ||
} else { | ||
UIManager.clearJSResponder(); | ||
} | ||
}, | ||
}; | ||
|
||
export default ReactFabricGlobalResponderHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters