mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8f3e188426
Summary: - Fix the StaticViewConfig violations for RCTView Changelog: [Internal] Reviewed By: yungsters Differential Revision: D32187835 fbshipit-source-id: c8c926817a9245b1e8671e5a2e8965ab7ffecace
41 lines
1.2 KiB
JavaScript
41 lines
1.2 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 codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
|
import {type ViewProps as Props} from './ViewPropTypes';
|
|
import * as React from 'react';
|
|
|
|
const ViewNativeComponent: HostComponent<Props> =
|
|
NativeComponentRegistry.get<Props>('RCTView', () => ({
|
|
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>;
|