mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
249435c4d5
Summary: With the conclusion of D27944688 (https://github.com/facebook/react-native/commit/925af8ddea040a352d37a5c0a9275d0754e47bf7), this backs out the experiment introduced via D27987619 (https://github.com/facebook/react-native/commit/f598dd0ee3670075e8f9480aeb1489e7ad5c63e8). Changelog: [Internal] Reviewed By: kacieb Differential Revision: D28799741 fbshipit-source-id: 607ee85db26326e13dd8ddb52f5aebb732e9a354
46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its 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 * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
|
|
import {type HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
import Platform from '../../Utilities/Platform';
|
|
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid';
|
|
import {type ViewProps as Props} from './ViewPropTypes';
|
|
import * as React from 'react';
|
|
|
|
const ViewNativeComponent: HostComponent<Props> = NativeComponentRegistry.get<Props>(
|
|
'RCTView',
|
|
() =>
|
|
Platform.OS === 'android'
|
|
? ReactNativeViewViewConfigAndroid
|
|
: {uiViewClassName: 'RCTView'},
|
|
);
|
|
|
|
interface NativeCommands {
|
|
+hotspotUpdate: (
|
|
viewRef: React.ElementRef<HostComponent<mixed>>,
|
|
x: number,
|
|
y: number,
|
|
) => void;
|
|
+setPressed: (
|
|
viewRef: React.ElementRef<HostComponent<mixed>>,
|
|
pressed: boolean,
|
|
) => void;
|
|
}
|
|
|
|
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
supportedCommands: ['hotspotUpdate', 'setPressed'],
|
|
});
|
|
|
|
export default ViewNativeComponent;
|
|
|
|
export type ViewNativeComponentType = HostComponent<Props>;
|