You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.0 KiB
40 lines
1.0 KiB
/**
|
|
* 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.
|
|
*
|
|
* @format
|
|
* @flow strict-local
|
|
*/
|
|
|
|
import type {ViewProps} from './ViewPropTypes';
|
|
|
|
import ViewNativeComponent from './ViewNativeComponent';
|
|
import TextAncestor from '../../Text/TextAncestor';
|
|
import * as React from 'react';
|
|
|
|
export type Props = ViewProps;
|
|
|
|
/**
|
|
* The most fundamental component for building a UI, View is a container that
|
|
* supports layout with flexbox, style, some touch handling, and accessibility
|
|
* controls.
|
|
*
|
|
* @see https://reactnative.dev/docs/view
|
|
*/
|
|
const View: React.AbstractComponent<
|
|
ViewProps,
|
|
React.ElementRef<typeof ViewNativeComponent>,
|
|
> = React.forwardRef((props: ViewProps, forwardedRef) => {
|
|
return (
|
|
<TextAncestor.Provider value={false}>
|
|
<ViewNativeComponent {...props} ref={forwardedRef} />
|
|
</TextAncestor.Provider>
|
|
);
|
|
});
|
|
|
|
View.displayName = 'View';
|
|
|
|
module.exports = View;
|