-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create option for out-of-tree platforms to customize ViewEventEmitter (…
…#38582) Summary: Pull Request resolved: #38582 Some out of tree platforms may have extra events (e.g., events for different input modalities) that don't exist on other platforms. For example, react-native-windows and react-native-macos have `onKeyUp` and `onKeyDown` that can be emitted from any native component. This change provides a hook for out of platforms to customize which events can be emitted from all native components. ## Changelog: [General] [Added] - Support additional View events in out of tree platform Fabric implementations Reviewed By: christophpurrer Differential Revision: D47721603 fbshipit-source-id: 5ae2ff0f6c1b1dfd72b0a310c1309a85e6b170b1
- Loading branch information
1 parent
646c759
commit 6e3e6b5
Showing
4 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
...nderer/components/view/platform/android/react/renderer/components/view/ViewEventEmitter.h
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,15 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <react/renderer/components/view/BaseViewEventEmitter.h> | ||
|
||
namespace facebook::react { | ||
using ViewEventEmitter = BaseViewEventEmitter; | ||
using SharedViewEventEmitter = std::shared_ptr<const ViewEventEmitter>; | ||
} // namespace facebook::react |
15 changes: 15 additions & 0 deletions
15
...t/renderer/components/view/platform/cxx/react/renderer/components/view/ViewEventEmitter.h
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,15 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <react/renderer/components/view/BaseViewEventEmitter.h> | ||
|
||
namespace facebook::react { | ||
using ViewEventEmitter = BaseViewEventEmitter; | ||
using SharedViewEventEmitter = std::shared_ptr<const ViewEventEmitter>; | ||
} // namespace facebook::react |