Conversation
| } | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ |
There was a problem hiding this comment.
In many of these files I moved the stylesheet declaration (or other code) above the example exports so that every example has the exports at the bottom for consistency
| } | ||
|
|
||
| class AnExApp extends React.Component<any, any> { | ||
| static title = 'Animated - Gratuitous App'; |
There was a problem hiding this comment.
Many of the example files used static properties to declare the title and description. This didn't work great with flow types and is inconsistent with the other examples so I moved them all to the exports
| const {DatePickerIOS, StyleSheet, Text, TextInput, View} = ReactNative; | ||
|
|
||
| class DatePickerExample extends React.Component< | ||
| class WithDatePickerData extends React.Component< |
There was a problem hiding this comment.
This needed refactored to export multiple examples
| @@ -1,29 +0,0 @@ | |||
| /** | |||
There was a problem hiding this comment.
I moved these types to shared/RNTesterTypes
| static title = '<Picker>'; | ||
| static description = | ||
| 'Provides multiple options to choose from, using either a dropdown menu or a dialog.'; | ||
| class BasicPickerExample extends React.Component<{}, $FlowFixMeState> { |
There was a problem hiding this comment.
Also needed to refactor this to export multiple examples
| return <this.props.module />; | ||
| } | ||
|
|
||
| if (this.props.module.examples.length === 1) { |
There was a problem hiding this comment.
Here are the main changes in this pull
If there is only one example exported, we just show the single example. This should maintain the existing behavior for modules until they're refactored to export multiple examples.
If there's more than one example exported, we add a filter which will filter by the example title
|
Spoke to @TheSavior and @CodingItWrong offline, closing this in favor of #22777 and breaking these changes out into multiple PRs |
This PR adds filtering to the examples in RNTester. This will allow us to filter the examples directly instead of scrolling (which is unreliable). Note, this replaces #22777
Additionally, it also:
titledescriptionandexamplesconsistentlyTodo in a followup:
Test Plan:
Here is an example of one of the tests that now use filtering: