mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: This changes adds an example to RNTester to verify that the Interop Layer can process bubbling events in Fabric as it used to do in Paper. ## Changelog: [iOS][Added] - Add example in the Interop Layer to use events Reviewed By: sammy-SC Differential Revision: D43911390 fbshipit-source-id: ae75db25078669676e5a609e090f1e9674026391
38 lines
897 B
JavaScript
38 lines
897 B
JavaScript
/**
|
|
* 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.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
import type {HostComponent} from 'react-native';
|
|
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
|
|
import {requireNativeComponent} from 'react-native';
|
|
|
|
type ColorChangedEvent = {
|
|
nativeEvent: {
|
|
backgroundColor: {
|
|
hue: number,
|
|
saturation: number,
|
|
brightness: number,
|
|
alpha: number,
|
|
},
|
|
},
|
|
};
|
|
|
|
type NativeProps = $ReadOnly<{|
|
|
...ViewProps,
|
|
opacity?: number,
|
|
color?: string,
|
|
onColorChanged?: (event: ColorChangedEvent) => void,
|
|
|}>;
|
|
|
|
export type MyLegacyViewType = HostComponent<NativeProps>;
|
|
|
|
export default (requireNativeComponent(
|
|
'RNTMyLegacyNativeView',
|
|
): HostComponent<NativeProps>);
|