Merge commit '06ce64356594a921cd9ae4f71c15dd56dd0e53a3' into amgleitman/0.64-merge-head

This commit is contained in:
Adam Gleitman 2021-09-22 18:08:01 -07:00
Родитель 0e18e8f6a6 06ce643565
Коммит 7dc9633b62
16 изменённых файлов: 207 добавлений и 138 удалений

Просмотреть файл

@ -24,7 +24,7 @@ class AnimatedDivision extends AnimatedWithChildren {
constructor(a: AnimatedNode | number, b: AnimatedNode | number) {
super();
if (b === 0) {
if (b === 0 || (b instanceof AnimatedNode && b.__getValue() === 0)) {
console.error('Detected potential division by zero in AnimatedDivision');
}
this._a = typeof a === 'number' ? new AnimatedValue(a) : a;

Просмотреть файл

@ -190,6 +190,16 @@ function Pressable(props: Props, forwardedRef): React.Node {
const hitSlop = normalizeRect(props.hitSlop);
const restPropsWithDefaults: React.ElementConfig<typeof View> = {
...restProps,
...android_rippleConfig?.viewProps,
acceptsFirstMouse: acceptsFirstMouse !== false && !disabled, // [TODO(macOS GH#774)
enableFocusRing: enableFocusRing !== false && !disabled, // ]TODO(macOS GH#774)
accessible: accessible !== false,
focusable: focusable !== false,
hitSlop,
};
const config = useMemo(
() => ({
disabled,
@ -239,14 +249,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
return (
<View
{...restProps}
{...restPropsWithDefaults}
{...eventHandlers}
{...android_rippleConfig?.viewProps}
acceptsFirstMouse={acceptsFirstMouse !== false && !disabled} // [TODO(macOS GH#774)
enableFocusRing={enableFocusRing !== false && !disabled} // ]TODO(macOS GH#774)
accessible={accessible !== false}
focusable={focusable !== false}
hitSlop={hitSlop}
ref={viewRef}
style={typeof style === 'function' ? style({pressed}) : style}
collapsable={false}>

Просмотреть файл

@ -22,7 +22,7 @@ class PerformanceOverlay extends React.Component<{...}> {
const items = [];
for (const key in perfLogs) {
if (perfLogs[key].totalTime) {
if (perfLogs[key]?.totalTime) {
const unit = key === 'BundleSize' ? 'b' : 'ms';
items.push(
<View style={styles.row} key={key}>

Просмотреть файл

@ -16,11 +16,16 @@ import Pressability, {
} from './Pressability';
import {useEffect, useRef} from 'react';
/**
* Creates a persistent instance of `Pressability` that automatically configures
* itself and resets. Accepts null `config` to support lazy initialization. Once
* initialized, will not un-initialize until the component has been unmounted.
*/
export default function usePressability(
config: PressabilityConfig,
): EventHandlers {
config: ?PressabilityConfig,
): ?EventHandlers {
const pressabilityRef = useRef<?Pressability>(null);
if (pressabilityRef.current == null) {
if (config != null && pressabilityRef.current == null) {
pressabilityRef.current = new Pressability(config);
}
const pressability = pressabilityRef.current;
@ -28,16 +33,20 @@ export default function usePressability(
// On the initial mount, this is a no-op. On updates, `pressability` will be
// re-configured to use the new configuration.
useEffect(() => {
pressability.configure(config);
if (config != null && pressability != null) {
pressability.configure(config);
}
}, [config, pressability]);
// On unmount, reset pending state and timers inside `pressability`. This is
// a separate effect because we do not want to reset when `config` changes.
useEffect(() => {
return () => {
pressability.reset();
};
if (pressability != null) {
return () => {
pressability.reset();
};
}
}, [pressability]);
return pressability.getEventHandlers();
return pressability == null ? null : pressability.getEventHandlers();
}

Просмотреть файл

@ -10,14 +10,13 @@
'use strict';
import {NativeText, NativeVirtualText} from './TextNativeComponent';
const DeprecatedTextPropTypes = require('../DeprecatedPropTypes/DeprecatedTextPropTypes');
const React = require('react');
const ReactNativeViewAttributes = require('../Components/View/ReactNativeViewAttributes');
const TextAncestor = require('./TextAncestor');
const Touchable = require('../Components/Touchable/Touchable');
const UIManager = require('../ReactNative/UIManager');
const createReactNativeComponentClass = require('../Renderer/shims/createReactNativeComponentClass');
const nullthrows = require('nullthrows');
const processColor = require('../StyleSheet/processColor');
@ -27,7 +26,7 @@ import type {PressRetentionOffset, TextProps} from './TextProps';
type ResponseHandlers = $ReadOnly<{|
onStartShouldSetResponder: () => boolean,
onResponderGrant: (event: PressEvent, dispatchID: string) => void,
onResponderGrant: (event: PressEvent) => void,
onResponderMove: (event: PressEvent) => void,
onResponderRelease: (event: PressEvent) => void,
onResponderTerminate: (event: PressEvent) => void,
@ -36,7 +35,7 @@ type ResponseHandlers = $ReadOnly<{|
type Props = $ReadOnly<{|
...TextProps,
forwardedRef: ?React.Ref<'RCTText' | 'RCTVirtualText'>,
forwardedRef: ?React.Ref<typeof NativeText | typeof NativeVirtualText>,
|}>;
type State = {|
@ -51,37 +50,6 @@ type State = {|
const PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
const viewConfig = {
validAttributes: {
...ReactNativeViewAttributes.UIView,
isHighlighted: true,
numberOfLines: true,
ellipsizeMode: true,
allowFontScaling: true,
maxFontSizeMultiplier: true,
disabled: true,
selectable: true,
selectionColor: true,
adjustsFontSizeToFit: true,
minimumFontScale: true,
textBreakStrategy: true,
onTextLayout: true,
onInlineViewLayout: true,
dataDetectorType: true,
tooltip: true,
android_hyphenationFrequency: true,
},
directEventTypes: {
topTextLayout: {
registrationName: 'onTextLayout',
},
topInlineViewLayout: {
registrationName: 'onInlineViewLayout',
},
},
uiViewClassName: 'RCTText',
};
/**
* A React component for displaying text.
*
@ -123,21 +91,19 @@ class TouchableText extends React.Component<Props, State> {
: null;
}
static viewConfig = viewConfig;
render(): React.Node {
let props = this.props;
if (isTouchable(props)) {
let {forwardedRef, selectionColor, ...props} = this.props;
if (isTouchable(this.props)) {
props = {
...props,
...this.state.responseHandlers,
isHighlighted: this.state.isHighlighted,
};
}
if (props.selectionColor != null) {
if (selectionColor != null) {
props = {
...props,
selectionColor: processColor(props.selectionColor),
selectionColor: processColor(selectionColor),
};
}
if (__DEV__) {
@ -152,16 +118,17 @@ class TouchableText extends React.Component<Props, State> {
<TextAncestor.Consumer>
{hasTextAncestor =>
hasTextAncestor ? (
<RCTVirtualText
// $FlowFixMe[prop-missing] For the `onClick` workaround.
<NativeVirtualText
{...props}
// This is used on Android to call a nested Text component's press handler from the context menu.
// TODO T75145059 Clean this up once Text is migrated off of Touchable
onClick={props.onPress}
ref={props.forwardedRef}
ref={forwardedRef}
/>
) : (
<TextAncestor.Provider value={true}>
<RCTText {...props} ref={props.forwardedRef} />
<NativeText {...props} ref={forwardedRef} />
</TextAncestor.Provider>
)
}
@ -264,26 +231,9 @@ const isTouchable = (props: Props): boolean =>
props.onLongPress != null ||
props.onStartShouldSetResponder != null;
const RCTText = createReactNativeComponentClass(
viewConfig.uiViewClassName,
() => viewConfig,
);
const RCTVirtualText =
UIManager.getViewManagerConfig('RCTVirtualText') == null
? RCTText
: createReactNativeComponentClass('RCTVirtualText', () => ({
validAttributes: {
...ReactNativeViewAttributes.UIView,
isHighlighted: true,
maxFontSizeMultiplier: true,
},
uiViewClassName: 'RCTVirtualText',
}));
const Text = (
props: TextProps,
forwardedRef: ?React.Ref<'RCTText' | 'RCTVirtualText'>,
forwardedRef: ?React.Ref<typeof NativeText | typeof NativeVirtualText>,
) => {
return <TouchableText {...props} forwardedRef={forwardedRef} />;
};

Просмотреть файл

@ -0,0 +1,68 @@
/**
* 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
* @format
*/
'use strict';
import ReactNativeViewAttributes from '../Components/View/ReactNativeViewAttributes';
import UIManager from '../ReactNative/UIManager';
import {type HostComponent} from '../Renderer/shims/ReactNativeTypes';
import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
import {type ProcessedColorValue} from '../StyleSheet/processColor';
import {type TextProps} from './TextProps';
type NativeTextProps = $ReadOnly<{
...TextProps,
isHighlighted?: ?boolean,
selectionColor?: ?ProcessedColorValue,
}>;
export const NativeText: HostComponent<NativeTextProps> = (createReactNativeComponentClass(
'RCTText',
() => ({
validAttributes: {
...ReactNativeViewAttributes.UIView,
isHighlighted: true,
numberOfLines: true,
ellipsizeMode: true,
allowFontScaling: true,
maxFontSizeMultiplier: true,
disabled: true,
selectable: true,
selectionColor: true,
adjustsFontSizeToFit: true,
minimumFontScale: true,
textBreakStrategy: true,
onTextLayout: true,
onInlineViewLayout: true,
dataDetectorType: true,
},
directEventTypes: {
topTextLayout: {
registrationName: 'onTextLayout',
},
topInlineViewLayout: {
registrationName: 'onInlineViewLayout',
},
},
uiViewClassName: 'RCTText',
}),
): any);
export const NativeVirtualText: HostComponent<NativeTextProps> =
UIManager.getViewManagerConfig('RCTVirtualText') == null
? NativeText
: (createReactNativeComponentClass('RCTVirtualText', () => ({
validAttributes: {
...ReactNativeViewAttributes.UIView,
isHighlighted: true,
maxFontSizeMultiplier: true,
},
uiViewClassName: 'RCTVirtualText',
})): any);

Просмотреть файл

@ -54,12 +54,12 @@ describe('PerformanceLogger', () => {
perfLogger.startTimespan(TIMESPAN_1);
perfLogger.close();
let timespan = perfLogger.getTimespans()[TIMESPAN_1];
expect(timespan.endTime).toBeUndefined();
expect(timespan.totalTime).toBeUndefined();
expect(timespan?.endTime).toBeUndefined();
expect(timespan?.totalTime).toBeUndefined();
perfLogger.stopTimespan(TIMESPAN_1);
timespan = perfLogger.getTimespans()[TIMESPAN_1];
expect(timespan.endTime).toBeUndefined();
expect(timespan.totalTime).toBeUndefined();
expect(timespan?.endTime).toBeUndefined();
expect(timespan?.totalTime).toBeUndefined();
});
});
@ -208,10 +208,10 @@ describe('PerformanceLogger', () => {
let perfLogger = createPerformanceLogger();
perfLogger.startTimespan(TIMESPAN_1, POINT_ANNOTATION_1);
perfLogger.stopTimespan(TIMESPAN_1, POINT_ANNOTATION_2);
expect(perfLogger.getTimespans()[TIMESPAN_1].startExtras).toEqual(
expect(perfLogger.getTimespans()[TIMESPAN_1]?.startExtras).toEqual(
POINT_ANNOTATION_1,
);
expect(perfLogger.getTimespans()[TIMESPAN_1].endExtras).toEqual(
expect(perfLogger.getTimespans()[TIMESPAN_1]?.endExtras).toEqual(
POINT_ANNOTATION_2,
);
});

Просмотреть файл

@ -41,15 +41,15 @@ export interface IPerformanceLogger {
clearCompleted(): void;
close(): void;
currentTimestamp(): number;
getExtras(): {[key: string]: ExtraValue, ...};
getPoints(): {[key: string]: number, ...};
getPointExtras(): {[key: string]: Extras, ...};
getTimespans(): {[key: string]: Timespan, ...};
getExtras(): {[key: string]: ?ExtraValue, ...};
getPoints(): {[key: string]: ?number, ...};
getPointExtras(): {[key: string]: ?Extras, ...};
getTimespans(): {[key: string]: ?Timespan, ...};
hasTimespan(key: string): boolean;
isClosed(): boolean;
logEverything(): void;
markPoint(key: string, timestamp?: number, extras?: Extras): void;
removeExtra(key: string): ExtraValue | void;
removeExtra(key: string): ?ExtraValue;
setExtra(key: string, value: ExtraValue): void;
startTimespan(key: string, extras?: Extras): void;
stopTimespan(key: string, extras?: Extras): void;
@ -60,10 +60,10 @@ const _cookies: {[key: string]: number, ...} = {};
const PRINT_TO_CONSOLE: false = false; // Type as false to prevent accidentally committing `true`;
class PerformanceLogger implements IPerformanceLogger {
_timespans: {[key: string]: Timespan} = {};
_extras: {[key: string]: ExtraValue} = {};
_points: {[key: string]: number} = {};
_pointExtras: {[key: string]: Extras, ...} = {};
_timespans: {[key: string]: ?Timespan} = {};
_extras: {[key: string]: ?ExtraValue} = {};
_points: {[key: string]: ?number} = {};
_pointExtras: {[key: string]: ?Extras, ...} = {};
_closed: boolean = false;
addTimespan(
@ -109,7 +109,7 @@ class PerformanceLogger implements IPerformanceLogger {
clearCompleted() {
for (const key in this._timespans) {
if (this._timespans[key].totalTime != null) {
if (this._timespans[key]?.totalTime != null) {
delete this._timespans[key];
}
}
@ -156,7 +156,7 @@ class PerformanceLogger implements IPerformanceLogger {
if (PRINT_TO_CONSOLE) {
// log timespans
for (const key in this._timespans) {
if (this._timespans[key].totalTime != null) {
if (this._timespans[key]?.totalTime != null) {
infoLog(key + ': ' + this._timespans[key].totalTime + 'ms');
}
}
@ -166,7 +166,9 @@ class PerformanceLogger implements IPerformanceLogger {
// log points
for (const key in this._points) {
infoLog(key + ': ' + this._points[key] + 'ms');
if (this._points[key] != null) {
infoLog(key + ': ' + this._points[key] + 'ms');
}
}
}
}
@ -178,7 +180,7 @@ class PerformanceLogger implements IPerformanceLogger {
}
return;
}
if (this._points[key]) {
if (this._points[key] != null) {
if (PRINT_TO_CONSOLE && __DEV__) {
infoLog(
'PerformanceLogger: Attempting to mark a point that has been already logged ',
@ -193,7 +195,7 @@ class PerformanceLogger implements IPerformanceLogger {
}
}
removeExtra(key: string): ExtraValue | void {
removeExtra(key: string): ?ExtraValue {
const value = this._extras[key];
delete this._extras[key];
return value;

Просмотреть файл

@ -110,12 +110,6 @@ using namespace facebook::react;
const auto &oldSliderProps = *std::static_pointer_cast<const SliderProps>(_props);
const auto &newSliderProps = *std::static_pointer_cast<const SliderProps>(props);
// `value`
if (oldSliderProps.value != newSliderProps.value) {
_sliderView.value = newSliderProps.value;
_previousValue = newSliderProps.value;
}
// `minimumValue`
if (oldSliderProps.minimumValue != newSliderProps.minimumValue) {
_sliderView.minimumValue = newSliderProps.minimumValue;
@ -126,6 +120,12 @@ using namespace facebook::react;
_sliderView.maximumValue = newSliderProps.maximumValue;
}
// `value`
if (oldSliderProps.value != newSliderProps.value) {
_sliderView.value = newSliderProps.value;
_previousValue = newSliderProps.value;
}
// `disabled`
if (oldSliderProps.disabled != newSliderProps.disabled) {
_sliderView.enabled = !newSliderProps.disabled;

Просмотреть файл

@ -117,6 +117,7 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
- (void)registerComponentViewClass:(Class<RCTComponentViewProtocol>)componentViewClass
{
RCTAssert(componentViewClass, @"RCTComponentViewFactory: Provided `componentViewClass` is `nil`.");
std::unique_lock<better::shared_mutex> lock(_mutex);
auto componentDescriptorProvider = [componentViewClass componentDescriptorProvider];

Просмотреть файл

@ -7,9 +7,20 @@
#import "RCTDatePicker.h"
#import <Availability.h>
#import <AvailabilityInternal.h>
#import "RCTUtils.h"
#import "UIView+React.h"
#ifndef __IPHONE_14_0
#define __IPHONE_14_0 140000
#endif // __IPHONE_14_0
#ifndef RCT_IOS_14_0_SDK_OR_LATER
#define RCT_IOS_14_0_SDK_OR_LATER (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0)
#endif // RCT_IOS_14_0_SDK_OR_LATER
@interface RCTDatePicker ()
@property (nonatomic, copy) RCTBubblingEventBlock onChange;
@ -31,9 +42,11 @@
_reactMinuteInterval = 1;
#if !TARGET_OS_OSX // TODO(macOS GH#774)
#if RCT_IOS_14_0_SDK_OR_LATER
if (@available(iOS 14, *)) {
self.preferredDatePickerStyle = UIDatePickerStyleWheels;
}
#endif // RCT_IOS_14_0_SDK_OR_LATER
#endif // ]TODO(macOS GH#774)
}
return self;

Просмотреть файл

@ -382,8 +382,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
mReactInstanceManager.createReactContextInBackground();
attachToReactInstanceManager();
} finally {
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
}

Просмотреть файл

@ -129,7 +129,8 @@ public class DialogModule extends NativeDialogManagerAndroidSpec implements Life
@Override
public void onClick(DialogInterface dialog, int which) {
if (!mCallbackConsumed) {
if (getReactApplicationContext().hasActiveCatalystInstance()) {
if (getReactApplicationContext().isBridgeless()
|| getReactApplicationContext().hasActiveCatalystInstance()) {
mCallback.invoke(ACTION_BUTTON_CLICKED, which);
mCallbackConsumed = true;
}
@ -139,7 +140,8 @@ public class DialogModule extends NativeDialogManagerAndroidSpec implements Life
@Override
public void onDismiss(DialogInterface dialog) {
if (!mCallbackConsumed) {
if (getReactApplicationContext().hasActiveCatalystInstance()) {
if (getReactApplicationContext().isBridgeless()
|| getReactApplicationContext().hasActiveCatalystInstance()) {
mCallback.invoke(ACTION_DISMISSED);
mCallbackConsumed = true;
}

Просмотреть файл

@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <react/renderer/core/ReactPrimitives.h>
#include <react/utils/Telemetry.h>

Просмотреть файл

@ -510,8 +510,8 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 694058e7c0ed05a9e217d1b3c7ded962f4180845
CocoaLibEvent: 2fab71b8bd46dd33ddb959f7928ec5909f838e3f
DoubleConversion: 2b45d0f8e156a5b02354c8a4062de64d41ccb4e0
FBLazyVector: eecafce9c52e737682c538e3f4389c20bd8ce988
FBReactNativeSpec: 60c6410b298d7e62dd1526795a47d778c7e4ee95
FBLazyVector: b1732bffe5205c68f04a13d588879b65c7000d50
FBReactNativeSpec: 65be0d17a2d21cd4f7fcac42a201d0785985c583
Flipper: be611d4b742d8c87fbae2ca5f44603a02539e365
Flipper-DoubleConversion: 38631e41ef4f9b12861c67d17cb5518d06badc41
Flipper-Folly: c12092ea368353b58e992843a990a3225d4533c3
@ -522,33 +522,33 @@ SPEC CHECKSUMS:
glog: 789873d01e4b200777d0a09bc23d548446758699
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
RCT-Folly: 55d0039b24e192081ec0b2257f7bd9f42e382fb7
RCTRequired: 16ce094ae4bdaace21922306ed61049804cd1740
RCTTypeSafety: 60f8ce9f8817b1c05f3aba954aca120ffa2f0463
React: 3d720991e99b41cbe9956a286721a849e37651eb
React-callinvoker: 7704b297d7d60288a1965e6abc0f2acfd88adc4d
React-Core: b345af5ffd6c30b2923387371bde77f4dd3f2db6
React-CoreModules: aa0aba2b67c6dd774a5196e02e807ce838ddf0af
React-cxxreact: 4a52094ed918582a1089e5be204e8e05af0edc01
React-jsi: 9d65fd0a050c05e2847dc10b40082a698e5077b5
React-jsiexecutor: 92ca511b1050eaea71147aa521b0fe1867a820d0
React-jsinspector: 3936a509dd5f27ac9f2886e44098fc5f1faafaf2
React-perflogger: f760da26667434ec71182b20483b4926424c8bd6
React-RCTActionSheet: f31e467d514a46048f4728bdb938c7d30433ea64
React-RCTAnimation: 6034473d4082f060465d4689e1e4c6e7928a7e94
React-RCTBlob: d1ab004359da5a1a23d36035afe3156a47fcf22f
React-RCTImage: d1ba7b749b72b9eb7a00aa19a38dbf119985e90d
React-RCTLinking: 0300fd476594ce06ca804654df7a78d7cc86db16
React-RCTNetwork: c02a0f76f6dd269c48c1044805767acbf3318381
React-RCTPushNotification: 5a3dba1977dd58db1d3bad5f9b3bb0b86b2c9202
React-RCTSettings: 6c553b617cd637d472defb4763994e1998f375ca
React-RCTTest: 6c3d781e69115c5cde8a5cb34519f0656019b7e4
React-RCTText: d4f40f7b106634a0a05ff8e52d0d30956f624e0f
React-RCTVibration: 402294ebe88afab5273a13f88549d40efb9ad834
React-runtimeexecutor: 442a5fcafa454d608d31f3cd5084e3ef4d469d3c
RCTRequired: d8d1e03214ca25e2fcd7921a6f74fd3a32760753
RCTTypeSafety: ade017eb21d3f666a9e9486ec500d7c66fcdffd4
React: a65562755ee36852ba78d68c905855bf5986a4f3
React-callinvoker: 505c39df3da9de7cbf471cf48457331147177064
React-Core: 0a1de28dc7ecf50bb7a555920f2253198c552b46
React-CoreModules: 7e95efa980e59c9946ce7e2fb132a864f9763299
React-cxxreact: e3f42a5592190441bfc0fcee1b03fbdf34dc1ba0
React-jsi: bdf53768a3c147a15f09c7097574a6b6038f3153
React-jsiexecutor: ac6821f507a6a976f26757a14809f2c1b8665bf9
React-jsinspector: a141f6678e44a22b24306b743da100a510375701
React-perflogger: 961fa1f81df412a98dbff55a9b6bdee615ea0b6c
React-RCTActionSheet: 9def3919beeadd13d3656c69ee947619f4de4cd3
React-RCTAnimation: 8975fd28dd3b6e2bad02a1d32961081894e8861c
React-RCTBlob: 2688bc0d47c664f330e6b304fd0a6d1426b7d60a
React-RCTImage: c7abd52b6ee3ece6dbd5f14e864c166698bd84ed
React-RCTLinking: 91e82a17e7d318ae332d1f85d8bb118ed62e3071
React-RCTNetwork: 380ee77375194c2ce7f194ee4c3a158eb19a2ae1
React-RCTPushNotification: c26ef8c86691923f90cace20bdab68872fe52264
React-RCTSettings: 1f29e83ead9e35c8db2cd5af98bd0e59598a6137
React-RCTTest: a9ccbd62f6cf3bc3ce418d1773eb6245f9b18d2a
React-RCTText: a3cbc6a1f0b350a239dcb0d98f6f42428b3421d2
React-RCTVibration: 9aeffdafeb92e0420ef2ad6814c79d5abb5c21b6
React-runtimeexecutor: e1afd7d4611a345cdd28bff7965adeb940031c32
React-TurboModuleCxx-RNW: 18bb71af41fe34c8b12a56bef60aae7ee32b0817
React-TurboModuleCxx-WinRTPort: 8716499b4b104c88a3edbba830e6ae30c3591d47
ReactCommon: ff5bb8b9c78d6d76c1d02aefaf23b6d28054ef43
Yoga: 52bdc3d06be314f070836295afbc0ae583a61f42
React-TurboModuleCxx-WinRTPort: a4653550eeb1ca808815f3a7cf015201b67c7965
ReactCommon: 52e026fcd83b18da242742d5edb2641383c159ff
Yoga: 0b9835795c69b91950ca85334db6dcb44cd3dadd
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: cb260f8f7765c910b68f8267cbd74709f6ae6e54

Просмотреть файл

@ -21,6 +21,7 @@ const {
Platform,
StyleSheet,
Text,
TextInput,
TouchableWithoutFeedback,
Switch,
View,
@ -86,6 +87,18 @@ const TextAlignmentExample = withRTLState(({isRTL, setRTL, ...props}) => {
);
});
const TextInputExample = withRTLState(({isRTL, setRTL, ...props}) => {
return (
<View>
<RTLToggler setRTL={setRTL} isRTL={isRTL} />
<View style={directionStyle(isRTL)}>
<Text style={props.style}>LRT or RTL TextInput.</Text>
<TextInput style={props.style} />
</View>
</View>
);
});
const IconsExample = withRTLState(({isRTL, setRTL}) => {
return (
<View>
@ -682,6 +695,13 @@ exports.examples = [
);
},
},
{
title: "Using textAlign: 'right' for TextInput",
description: ('Flip TextInput direction to RTL': string),
render: function(): React.Element<any> {
return <TextInputExample style={[styles.textAlignRight]} />;
},
},
{
title: 'Working With Icons',
render: function(): React.Element<any> {