diff --git a/Libraries/Animated/AnimatedMock.js b/Libraries/Animated/AnimatedMock.js index 225669b1f640c9..ca6741719482d9 100644 --- a/Libraries/Animated/AnimatedMock.js +++ b/Libraries/Animated/AnimatedMock.js @@ -56,7 +56,12 @@ const spring = function( return { ...emptyAnimation, start: (callback?: ?EndCallback): void => { - anyValue.setValue(config.toValue); + // TODO(macOS GH#774) - setValue can't handle AnimatedNodes + if (config.toValue instanceof AnimatedNode) { + anyValue.setValue(config.toValue.__getValue()); + } else { + anyValue.setValue(config.toValue); + } callback && callback({finished: true}); }, }; diff --git a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js index 952d3f4ef0f941..b12eb19f2bbd63 100644 --- a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js +++ b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js @@ -716,26 +716,28 @@ class AccessibilityActionsExample extends React.Component<{}> { /> - - { - switch (event.nativeEvent.actionName) { - case 'activate': - Alert.alert('Alert', 'Activate accessiblity action'); - break; - case 'copy': - Alert.alert('Alert', 'copy action success'); - break; - } - }}> - Text - - + {/* TODO(macOS GH#774) - This doesn't work, see https://github.com/facebook/react-native/issues/32616 + + { + switch (event.nativeEvent.actionName) { + case 'activate': + Alert.alert('Alert', 'Activate accessiblity action'); + break; + case 'copy': + Alert.alert('Alert', 'copy action success'); + break; + } + }}> + Text + + + */} ); } @@ -962,15 +964,22 @@ class EnabledExamples extends React.Component<{}> { } // [TODO(OSS Candidate ISS#2710739) type DisplayOptionsStatusExampleState = { - highContrastEnabled: boolean, - invertColorsEnabled: boolean, - reduceMotionEnabled: boolean, - reduceTransparencyEnabled: boolean, + highContrastEnabled?: boolean, + invertColorsEnabled?: boolean, + reduceMotionEnabled?: boolean, + reduceTransparencyEnabled?: boolean, }; class DisplayOptionsStatusExample extends React.Component< {}, DisplayOptionsStatusExampleState, > { + state: DisplayOptionsStatusExampleState = { + highContrastEnabled: undefined, + invertColorsEnabled: undefined, + reduceMotionEnabled: undefined, + reduceTransparencyEnabled: undefined, + }; + componentDidMount() { AccessibilityInfo.addEventListener( 'highContrastChanged', @@ -1056,31 +1065,40 @@ class DisplayOptionsStatusExample extends React.Component< }); }; + // TODO(macOS GH#774) - slight refactoring to allow state to handle undefined values + _statusString = isEnabled => { + if (isEnabled !== undefined) { + return isEnabled ? 'enabled' : 'disabled'; + } else { + return 'unknown'; + } + }; + render(): React.Node { return ( High contrast is{' '} - {this.state.highContrastEnabled ? 'enabled' : 'disabled'}. + {this._statusString(this.state.highContrastEnabled)}. Invert colors is{' '} - {this.state.invertColorsEnabled ? 'enabled' : 'disabled'}. + {this._statusString(this.state.invertColorsEnabled)}. Reduce motion is{' '} - {this.state.reduceMotionEnabled ? 'enabled' : 'disabled'}. + {this._statusString(this.state.reduceMotionEnabled)}. Reduce transparency is{' '} - {this.state.reduceTransparencyEnabled ? 'enabled' : 'disabled'}. + {this._statusString(this.state.reduceTransparencyEnabled)}.