mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
[Flow] v0.11.0 cleaning - Part 14 (react-native-github)
This commit is contained in:
committed by
Christopher Chedeau
parent
4a137aa840
commit
184bb1151a
@@ -30,6 +30,8 @@ var {
|
||||
var { TestModule } = React.addons;
|
||||
var Settings = require('Settings');
|
||||
|
||||
import type { Example, ExampleModule } from 'ExampleTypes';
|
||||
|
||||
var createExamplePage = require('./createExamplePage');
|
||||
|
||||
var COMPONENTS = [
|
||||
@@ -107,9 +109,17 @@ COMPONENTS.concat(APIS).forEach((Example) => {
|
||||
}
|
||||
});
|
||||
|
||||
class UIExplorerList extends React.Component {
|
||||
type Props = {
|
||||
navigator: Array<{title: string, component: ReactClass<any,any,any>}>,
|
||||
onExternalExampleRequested: Function,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
|
||||
|
||||
class UIExplorerList extends React.Component {
|
||||
props: Props;
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
dataSource: ds.cloneWithRowsAndSections({
|
||||
@@ -149,7 +159,7 @@ class UIExplorerList extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
_renderSectionHeader(data, section) {
|
||||
_renderSectionHeader(data: any, section: string) {
|
||||
return (
|
||||
<View style={styles.sectionHeader}>
|
||||
<Text style={styles.sectionHeaderTitle}>
|
||||
@@ -159,7 +169,7 @@ class UIExplorerList extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
_renderRow(example, i) {
|
||||
_renderRow(example: ExampleModule, i: number) {
|
||||
return (
|
||||
<View key={i}>
|
||||
<TouchableHighlight onPress={() => this._onPressRow(example)}>
|
||||
@@ -177,7 +187,7 @@ class UIExplorerList extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
_search(text) {
|
||||
_search(text: mixed) {
|
||||
var regex = new RegExp(text, 'i');
|
||||
var filter = (component) => regex.test(component.title);
|
||||
|
||||
@@ -191,7 +201,7 @@ class UIExplorerList extends React.Component {
|
||||
Settings.set({searchText: text});
|
||||
}
|
||||
|
||||
_onPressRow(example) {
|
||||
_onPressRow(example: ExampleModule) {
|
||||
if (example.external) {
|
||||
this.props.onExternalExampleRequested(example);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user