mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Add flow types RNTester examples (#22829)
Summary: This PR adds flow types for the RNTester examples, and updates all of the RNTester examples to match the flow type consistently. Previously, there was a mix of static class definitions and whether or not pages exported examples or a component. Now we will always export the same way, enforced by flow types Note: I also fixed most of the $FlowFixMe in changed components Pull Request resolved: https://github.com/facebook/react-native/pull/22829 Reviewed By: cpojer Differential Revision: D13563191 Pulled By: rickhanlonii fbshipit-source-id: b697e3346a863d1b130881592b0522a96c202b63
This commit is contained in:
committed by
Facebook Github Bot
parent
34ee8250b5
commit
bd32234e6e
@@ -15,6 +15,22 @@ const ReactNative = require('react-native');
|
||||
const {Animated, Easing, StyleSheet, Text, View} = ReactNative;
|
||||
const RNTesterButton = require('./RNTesterButton');
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
content: {
|
||||
backgroundColor: 'deepskyblue',
|
||||
borderWidth: 1,
|
||||
borderColor: 'dodgerblue',
|
||||
padding: 20,
|
||||
margin: 20,
|
||||
borderRadius: 10,
|
||||
alignItems: 'center',
|
||||
},
|
||||
rotatingImage: {
|
||||
width: 70,
|
||||
height: 70,
|
||||
},
|
||||
});
|
||||
|
||||
exports.framework = 'React';
|
||||
exports.title = 'Animated - Examples';
|
||||
exports.description =
|
||||
@@ -58,11 +74,11 @@ exports.examples = [
|
||||
);
|
||||
}
|
||||
}
|
||||
class FadeInExample extends React.Component<$FlowFixMeProps, any> {
|
||||
/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an
|
||||
* error found when Flow v0.85 was deployed. To see the error, delete
|
||||
* this comment and run Flow. */
|
||||
constructor(props) {
|
||||
|
||||
type Props = $ReadOnly<{||}>;
|
||||
type State = {|show: boolean|};
|
||||
class FadeInExample extends React.Component<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
show: true,
|
||||
@@ -287,19 +303,3 @@ exports.examples = [
|
||||
render: () => <Text>Checkout the Gratuitous Animation App!</Text>,
|
||||
},
|
||||
];
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
content: {
|
||||
backgroundColor: 'deepskyblue',
|
||||
borderWidth: 1,
|
||||
borderColor: 'dodgerblue',
|
||||
padding: 20,
|
||||
margin: 20,
|
||||
borderRadius: 10,
|
||||
alignItems: 'center',
|
||||
},
|
||||
rotatingImage: {
|
||||
width: 70,
|
||||
height: 70,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user