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:
Rick Hanlon
2018-12-31 08:26:00 -08:00
committed by Facebook Github Bot
parent 34ee8250b5
commit bd32234e6e
58 changed files with 715 additions and 503 deletions

View File

@@ -19,12 +19,6 @@ const Switch = require('Switch');
const Text = require('Text');
const View = require('View');
exports.displayName = (undefined: ?string);
exports.framework = 'React';
exports.title = '<SafeAreaView>';
exports.description =
'SafeAreaView automatically applies paddings reflect the portion of the view that is not covered by other (special) ancestor views.';
class SafeAreaViewExample extends React.Component<
{},
{|
@@ -100,6 +94,27 @@ class IsIPhoneXExample extends React.Component<{}> {
}
}
const styles = StyleSheet.create({
modal: {
flex: 1,
},
safeArea: {
flex: 1,
height: 1000,
},
safeAreaContent: {
flex: 1,
backgroundColor: '#ffaaaa',
alignItems: 'center',
justifyContent: 'center',
},
});
exports.displayName = (undefined: ?string);
exports.framework = 'React';
exports.title = '<SafeAreaView>';
exports.description =
'SafeAreaView automatically applies paddings reflect the portion of the view that is not covered by other (special) ancestor views.';
exports.examples = [
{
title: '<SafeAreaView> Example',
@@ -117,19 +132,3 @@ exports.examples = [
render: () => <IsIPhoneXExample />,
},
];
const styles = StyleSheet.create({
modal: {
flex: 1,
},
safeArea: {
flex: 1,
height: 1000,
},
safeAreaContent: {
flex: 1,
backgroundColor: '#ffaaaa',
alignItems: 'center',
justifyContent: 'center',
},
});