mirror of
https://github.com/react/react-native.git
synced 2026-09-28 13:23:09 +08:00
Deploy 0.217.0 to fbsource (#39610)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39610 Reviewed By: SamChou19815 Differential Revision: D49522399 fbshipit-source-id: 98dc8ce53a4dea2b68909fda5f92251c6cc91717
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0f2ecd3254
commit
29f62a41b4
+1
-1
@@ -77,4 +77,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.216.1
|
||||
^0.217.0
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@
|
||||
"eslint-plugin-redundant-undefined": "^0.4.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"flow-api-translator": "0.15.0",
|
||||
"flow-bin": "^0.216.1",
|
||||
"flow-bin": "^0.217.0",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-eslint": "0.15.0",
|
||||
"inquirer": "^7.1.0",
|
||||
|
||||
@@ -15,6 +15,7 @@ const {verifyPropNotAlreadyDefined} = require('../../parsers-commons');
|
||||
import type {TypeDeclarationMap, PropAST, ASTNode} from '../../utils';
|
||||
import type {BuildSchemaFN, Parser} from '../../parser';
|
||||
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
function getTypeAnnotationForArray<+T>(
|
||||
name: string,
|
||||
typeAnnotation: $FlowFixMe,
|
||||
@@ -206,6 +207,7 @@ function flattenProperties(
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
function getTypeAnnotation<+T>(
|
||||
name: string,
|
||||
annotation: $FlowFixMe | ASTNode,
|
||||
|
||||
@@ -105,6 +105,7 @@ function wrapModuleSchema(
|
||||
};
|
||||
}
|
||||
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
function unwrapNullable<+T: NativeModuleTypeAnnotation>(
|
||||
x: Nullable<T>,
|
||||
): [T, boolean] {
|
||||
@@ -115,6 +116,7 @@ function unwrapNullable<+T: NativeModuleTypeAnnotation>(
|
||||
return [x, false];
|
||||
}
|
||||
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
function wrapNullable<+T: NativeModuleTypeAnnotation>(
|
||||
nullable: boolean,
|
||||
typeAnnotation: T,
|
||||
|
||||
@@ -18,6 +18,7 @@ import * as React from 'react';
|
||||
* @see https://github.com/facebook/react-native/commit/b8c8562
|
||||
*/
|
||||
const FlatListWithEventThrottle = React.forwardRef(
|
||||
// $FlowFixMe[incompatible-call]
|
||||
(
|
||||
props: React.ElementConfig<typeof FlatList>,
|
||||
ref:
|
||||
|
||||
@@ -61,6 +61,7 @@ const AnimatedScrollView: AnimatedComponentType<Props, Instance> =
|
||||
});
|
||||
|
||||
const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
||||
// $FlowFixMe[incompatible-call]
|
||||
(
|
||||
props: {
|
||||
...React.ElementConfig<typeof ScrollView>,
|
||||
@@ -76,6 +77,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
||||
const {intermediatePropsForRefreshControl, intermediatePropsForScrollView} =
|
||||
useMemo(() => {
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
// $FlowFixMe[incompatible-call]
|
||||
const {outer, inner} = splitLayoutProps(flattenStyle(props.style));
|
||||
return {
|
||||
intermediatePropsForRefreshControl: {style: outer},
|
||||
|
||||
@@ -19,6 +19,7 @@ import * as React from 'react';
|
||||
* @see https://github.com/facebook/react-native/commit/b8c8562
|
||||
*/
|
||||
const SectionListWithEventThrottle = React.forwardRef(
|
||||
// $FlowFixMe[incompatible-call]
|
||||
(
|
||||
props: React.ElementConfig<typeof SectionList>,
|
||||
ref:
|
||||
|
||||
@@ -37,6 +37,7 @@ export default function createAnimatedComponent<TProps: {...}, TInstance>(
|
||||
// $FlowFixMe[incompatible-call]
|
||||
props,
|
||||
);
|
||||
// $FlowFixMe[incompatible-call]
|
||||
const ref = useMergeRefs<TInstance | null>(callbackRef, forwardedRef);
|
||||
|
||||
// Some components require explicit passthrough values for animation
|
||||
|
||||
@@ -1665,6 +1665,7 @@ class ScrollView extends React.Component<Props, State> {
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
const style = flattenStyle(this.props.style);
|
||||
const childLayoutProps = ['alignItems', 'justifyContent'].filter(
|
||||
// $FlowFixMe[incompatible-use]
|
||||
prop => style && style[prop] !== undefined,
|
||||
);
|
||||
invariant(
|
||||
@@ -1836,6 +1837,7 @@ class ScrollView extends React.Component<Props, State> {
|
||||
// Note: we should split props.style on the inner and outer props
|
||||
// however, the ScrollView still needs the baseStyle to be scrollable
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
// $FlowFixMe[incompatible-call]
|
||||
const {outer, inner} = splitLayoutProps(flattenStyle(props.style));
|
||||
return React.cloneElement(
|
||||
refreshControl,
|
||||
@@ -1923,6 +1925,7 @@ function Wrapper(props, ref: (mixed => mixed) | {current: mixed, ...}) {
|
||||
return <ScrollView {...props} scrollViewRef={ref} />;
|
||||
}
|
||||
Wrapper.displayName = 'ScrollView';
|
||||
// $FlowFixMe[incompatible-call]
|
||||
const ForwardedScrollView = React.forwardRef(Wrapper);
|
||||
|
||||
// $FlowFixMe[prop-missing] Add static context to ForwardedScrollView
|
||||
|
||||
+1
@@ -67,6 +67,7 @@ const ScrollViewStickyHeaderWithForwardedRef: React.AbstractComponent<
|
||||
}, []);
|
||||
const ref: (React.ElementRef<typeof Animated.View> | null) => void =
|
||||
// $FlowFixMe[incompatible-type] - Ref is mutated by `callbackRef`.
|
||||
// $FlowFixMe[incompatible-call]
|
||||
useMergeRefs<Instance | null>(callbackRef, forwardedRef);
|
||||
|
||||
const offset = useMemo(
|
||||
|
||||
@@ -155,6 +155,7 @@ const SwitchWithForwardedRef: React.AbstractComponent<
|
||||
typeof SwitchNativeComponent | typeof AndroidSwitchNativeComponent,
|
||||
> | null>(null);
|
||||
|
||||
// $FlowFixMe[incompatible-call]
|
||||
const ref = useMergeRefs(nativeSwitchRef, forwardedRef);
|
||||
|
||||
const [native, setNative] = React.useState({value: (null: ?boolean)});
|
||||
|
||||
@@ -1636,6 +1636,7 @@ const autoCompleteWebToTextContentTypeMap = {
|
||||
const ExportedForwardRef: React.AbstractComponent<
|
||||
React.ElementConfig<typeof InternalTextInput>,
|
||||
TextInputInstance,
|
||||
// $FlowFixMe[incompatible-call]
|
||||
> = React.forwardRef(function TextInput(
|
||||
{
|
||||
allowFontScaling = true,
|
||||
@@ -1658,8 +1659,13 @@ const ExportedForwardRef: React.AbstractComponent<
|
||||
let style = flattenStyle(restProps.style);
|
||||
|
||||
if (style?.verticalAlign != null) {
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe[cannot-write]
|
||||
style.textAlignVertical =
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
verticalAlignToTextAlignVerticalMap[style.verticalAlign];
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe[cannot-write]
|
||||
delete style.verticalAlign;
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ class TouchableOpacity extends React.Component<Props, State> {
|
||||
|
||||
_getChildStyleOpacityWithDefault(): number {
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
// $FlowFixMe[prop-missing]
|
||||
const opacity = flattenStyle(this.props.style)?.opacity;
|
||||
return typeof opacity === 'number' ? opacity : 1;
|
||||
}
|
||||
@@ -303,8 +304,10 @@ class TouchableOpacity extends React.Component<Props, State> {
|
||||
if (
|
||||
this.props.disabled !== prevProps.disabled ||
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
// $FlowFixMe[prop-missing]
|
||||
flattenStyle(prevProps.style)?.opacity !==
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
// $FlowFixMe[prop-missing]
|
||||
flattenStyle(this.props.style)?.opacity
|
||||
) {
|
||||
this._opacityInactive(250);
|
||||
|
||||
+1
@@ -181,6 +181,7 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
// $FlowFixMe[incompatible-call]
|
||||
return React.cloneElement(element, elementProps, ...children);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ const View: React.AbstractComponent<
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
let style = flattenStyle(otherProps.style);
|
||||
|
||||
// $FlowFixMe[sketchy-null-mixed]
|
||||
const newPointerEvents = style?.pointerEvents || pointerEvents;
|
||||
const collapsableOverride =
|
||||
ReactNativeFeatureFlags.shouldForceUnflattenForElevation()
|
||||
@@ -131,6 +132,7 @@ const View: React.AbstractComponent<
|
||||
}
|
||||
nativeID={id ?? nativeID}
|
||||
style={style}
|
||||
// $FlowFixMe[incompatible-type]
|
||||
pointerEvents={newPointerEvents}
|
||||
ref={forwardedRef}
|
||||
/>
|
||||
|
||||
@@ -197,11 +197,14 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
||||
};
|
||||
|
||||
const objectFit =
|
||||
// $FlowFixMe[prop-missing]
|
||||
style && style.objectFit
|
||||
? convertObjectFitToResizeMode(style.objectFit)
|
||||
? // $FlowFixMe[incompatible-call]
|
||||
convertObjectFitToResizeMode(style.objectFit)
|
||||
: null;
|
||||
// $FlowFixMe[prop-missing]
|
||||
const resizeMode =
|
||||
// $FlowFixMe[prop-missing]
|
||||
objectFit || props.resizeMode || (style && style.resizeMode) || 'cover';
|
||||
|
||||
return (
|
||||
@@ -220,7 +223,9 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
||||
if (hasTextAncestor) {
|
||||
return (
|
||||
<TextInlineImageNativeComponent
|
||||
// $FlowFixMe[incompatible-type]
|
||||
style={style}
|
||||
// $FlowFixMe[incompatible-type]
|
||||
resizeMode={resizeMode}
|
||||
headers={nativeProps.headers}
|
||||
src={sources}
|
||||
@@ -232,6 +237,7 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
||||
return (
|
||||
<ImageViewNativeComponent
|
||||
{...nativePropsWithAnalytics}
|
||||
// $FlowFixMe[incompatible-type]
|
||||
resizeMode={resizeMode}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -133,7 +133,8 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
||||
const objectFit =
|
||||
// $FlowFixMe[prop-missing]
|
||||
style && style.objectFit
|
||||
? convertObjectFitToResizeMode(style.objectFit)
|
||||
? // $FlowFixMe[incompatible-call]
|
||||
convertObjectFitToResizeMode(style.objectFit)
|
||||
: null;
|
||||
const resizeMode =
|
||||
// $FlowFixMe[prop-missing]
|
||||
@@ -178,6 +179,7 @@ const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
||||
accessibilityLabel={accessibilityLabel ?? props.alt}
|
||||
ref={forwardedRef}
|
||||
style={style}
|
||||
// $FlowFixMe[incompatible-type]
|
||||
resizeMode={resizeMode}
|
||||
tintColor={tintColor}
|
||||
source={sources}
|
||||
|
||||
@@ -98,7 +98,9 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {
|
||||
// So, we have to proxy/reapply these styles explicitly for actual <Image> component.
|
||||
// This workaround should be removed after implementing proper support of
|
||||
// intrinsic content size of the <Image>.
|
||||
// $FlowFixMe[prop-missing]
|
||||
width: flattenedStyle?.width,
|
||||
// $FlowFixMe[prop-missing]
|
||||
height: flattenedStyle?.height,
|
||||
},
|
||||
imageStyle,
|
||||
|
||||
@@ -69,6 +69,7 @@ module.exports = {
|
||||
// TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads`
|
||||
get flattenStyle(): flattenStyle<DangerouslyImpreciseStyleProp> {
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
// $FlowFixMe[incompatible-return]
|
||||
return require('../StyleSheet/flattenStyle');
|
||||
},
|
||||
get ReactFiberErrorDialog(): ReactFiberErrorDialog {
|
||||
|
||||
@@ -363,6 +363,7 @@ module.exports = {
|
||||
/**
|
||||
* Creates a StyleSheet style reference from the given object.
|
||||
*/
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
create<+S: ____Styles_Internal>(obj: S): $ReadOnly<S> {
|
||||
// TODO: This should return S as the return type. But first,
|
||||
// we need to codemod all the callsites that are typing this
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
import type {DangerouslyImpreciseStyleProp} from './StyleSheet';
|
||||
import type {____FlattenStyleProp_Internal} from './StyleSheetTypes';
|
||||
|
||||
// $FlowFixMe[unsupported-variance-annotation]
|
||||
function flattenStyle<+TStyleProp: DangerouslyImpreciseStyleProp>(
|
||||
style: ?TStyleProp,
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
@@ -30,11 +31,14 @@ function flattenStyle<+TStyleProp: DangerouslyImpreciseStyleProp>(
|
||||
// $FlowFixMe[underconstrained-implicit-instantiation]
|
||||
const computedStyle = flattenStyle(style[i]);
|
||||
if (computedStyle) {
|
||||
// $FlowFixMe[invalid-in-rhs]
|
||||
for (const key in computedStyle) {
|
||||
// $FlowFixMe[incompatible-use]
|
||||
result[key] = computedStyle[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
// $FlowFixMe[incompatible-return]
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+10
@@ -214,18 +214,28 @@ const Text: React.AbstractComponent<
|
||||
style = flattenStyle(style);
|
||||
|
||||
if (typeof style?.fontWeight === 'number') {
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe[cannot-write]
|
||||
style.fontWeight = style?.fontWeight.toString();
|
||||
}
|
||||
|
||||
let _selectable = restProps.selectable;
|
||||
if (style?.userSelect != null) {
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
_selectable = userSelectToSelectableMap[style.userSelect];
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe[cannot-write]
|
||||
delete style.userSelect;
|
||||
}
|
||||
|
||||
if (style?.verticalAlign != null) {
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe[cannot-write]
|
||||
style.textAlignVertical =
|
||||
// $FlowFixMe[invalid-computed-prop]
|
||||
verticalAlignToTextAlignVerticalMap[style.verticalAlign];
|
||||
// $FlowFixMe[prop-missing]
|
||||
// $FlowFixMe[cannot-write]
|
||||
delete style.verticalAlign;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ type Props = {
|
||||
};
|
||||
|
||||
const BaseFlatListExample = React.forwardRef(
|
||||
// $FlowFixMe[incompatible-call]
|
||||
(
|
||||
props: Props,
|
||||
ref:
|
||||
|
||||
@@ -5038,10 +5038,10 @@ flow-api-translator@0.15.0:
|
||||
hermes-parser "0.15.0"
|
||||
hermes-transform "0.15.0"
|
||||
|
||||
flow-bin@^0.216.1:
|
||||
version "0.216.1"
|
||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.216.1.tgz#c370af830e46645087a2aea4056507cc44acc031"
|
||||
integrity sha512-mdhkQiSSZ/nyPq/pmk2tdbV3btYTlTYqBT/96nSSTGQmvTWQ0no9XMLZ/SygNafL4PPerfkpwQwprA1M35+9Bg==
|
||||
flow-bin@^0.217.0:
|
||||
version "0.217.0"
|
||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.217.0.tgz#c255b4d8d815520d396416c2f712ab849d61f467"
|
||||
integrity sha512-AbbDE6QUpR+jpY9ejNROAk0P5D/2PxJzjU4D5vfmMwtS+QjjPjzfZGuatEJIn2k4PTZ2agbncaCtyHGO0AvG7A==
|
||||
|
||||
flow-enums-runtime@^0.0.6:
|
||||
version "0.0.6"
|
||||
|
||||
Reference in New Issue
Block a user