Skip to content

Commit b442f90

Browse files
rickhanloniifacebook-github-bot
authored andcommitted
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: facebook/react-native#22829 Reviewed By: cpojer Differential Revision: D13563191 Pulled By: rickhanlonii fbshipit-source-id: b697e3346a863d1b130881592b0522a96c202b63
1 parent 1780da7 commit b442f90

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

ViewPagerAndroidExample.android.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ const IMAGE_URIS = [
3333
'https://apod.nasa.gov/apod/image/1510/lunareclipse_27Sep_beletskycrop4.jpg',
3434
];
3535

36-
class LikeCount extends React.Component {
36+
type Props = $ReadOnly<{||}>;
37+
type State = {|likes: number|};
38+
class LikeCount extends React.Component<Props, State> {
3739
state = {
3840
likes: 7,
3941
};
@@ -92,10 +94,6 @@ class ProgressBar extends React.Component {
9294
}
9395

9496
class ViewPagerAndroidExample extends React.Component {
95-
static title = '<ViewPagerAndroid>';
96-
static description =
97-
'Container that allows to flip left and right between child views.';
98-
9997
state = {
10098
page: 0,
10199
animationsAreEnabled: true,
@@ -291,4 +289,15 @@ const styles = StyleSheet.create({
291289
},
292290
});
293291

294-
module.exports = ViewPagerAndroidExample;
292+
exports.title = '<ViewPagerAndroid>';
293+
exports.description =
294+
'Container that allows to flip left and right between child views.';
295+
296+
exports.examples = [
297+
{
298+
title: 'Basic pager',
299+
render(): React.Element<typeof ViewPagerAndroidExample> {
300+
return <ViewPagerAndroidExample />;
301+
},
302+
},
303+
];

0 commit comments

Comments
 (0)