File tree 9 files changed +50
-13
lines changed
mobile/ReactNativeTutorial
9 files changed +50
-13
lines changed Original file line number Diff line number Diff line change 30
30
no-console : 0
31
31
import/imports-first : 2
32
32
import/prefer-default-export : 2
33
+ no-duplicate-imports : 0
33
34
34
35
# Delegating proptypes check to flow
35
36
react/prop-types : 0
Original file line number Diff line number Diff line change 23
23
.*/Libraries/react-native/React.js
24
24
.*/Libraries/react-native/ReactNative.js
25
25
.*/node_modules/jest-runtime/build/__tests__/.*
26
+ .*/node_modules/react/node_modules/.*
27
+ .*/node_modules/react-native-experimental-navigation/.*
28
+ .*/node_modules/react-native/Libraries/Components/StaticContainer.js
29
+
30
+ # Json lint doesn't pass flow
31
+ .*/node_modules/jsonlint/.*
26
32
27
33
[include]
28
34
@@ -48,8 +54,11 @@ suppress_type=$FlowIssue
48
54
suppress_type=$FlowFixMe
49
55
suppress_type=$FixMe
50
56
51
- suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52
- suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
57
+ suppress_type=$FlowIgnore
58
+ suppress_comment=\\(.\\|\n\\)*\\$FlowIgnore
59
+
60
+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
61
+ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
53
62
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
54
63
55
64
unsafe.enable_getters_and_setters=true
Original file line number Diff line number Diff line change @@ -4,12 +4,11 @@ import { View } from 'react-native';
4
4
import { FormLabel , FormInput , Button } from 'react-native-elements' ;
5
5
6
6
import withAddProps from '../../hocs/withAddProps' ;
7
+ import type { AddPropsType } from '../../hocs/withAddProps' ;
7
8
8
9
import styles from './AddStyle' ;
9
10
10
- type PropsType = {
11
-
12
- }
11
+ type PropsType = AddPropsType ;
13
12
14
13
const Add = ( props : PropsType ) => (
15
14
< View >
Original file line number Diff line number Diff line change @@ -4,12 +4,11 @@ import { View } from 'react-native';
4
4
import List from './List/List' ;
5
5
import Footer from './Footer/Footer' ;
6
6
import withIndexProps from '../../hocs/withIndexProps' ;
7
+ import type { IndexPropsType } from '../../hocs/withIndexProps' ;
7
8
8
9
import styles from './IndexStyle' ;
9
10
10
- type PropsType = {
11
-
12
- }
11
+ type PropsType = IndexPropsType ;
13
12
14
13
class Index extends React . Component {
15
14
Original file line number Diff line number Diff line change
1
+ // @flow
1
2
import React from 'react' ;
2
3
import { View , Text } from 'react-native' ;
3
4
Original file line number Diff line number Diff line change 2
2
import React from 'react' ;
3
3
import { ListView , RefreshControl } from 'react-native' ;
4
4
import _ from 'lodash/fp' ;
5
+ import type { IndexPropsType } from '../../../hocs/withIndexProps' ;
5
6
import Item from './Item/Item' ;
6
7
7
8
import styles from './ListStyle' ;
8
9
9
- type PropsType = {
10
- }
10
+ type PropsType = IndexPropsType ;
11
11
12
12
const List = ( props : PropsType ) => {
13
13
const data = _ . compose (
Original file line number Diff line number Diff line change @@ -6,6 +6,16 @@ import { createSelector } from 'reselect';
6
6
import commentFormSelector from '../../../selectors/commentFormSelector' ;
7
7
import { actions } from '../sagas' ;
8
8
9
+ export type AddPropsType = {
10
+ author ?: string ,
11
+ text ?: string ,
12
+ actions : {
13
+ fetch : ( ) => void ,
14
+ updateForm : ( payload : Object ) => void ,
15
+ createComment : ( payload : Object ) => void ,
16
+ }
17
+ }
18
+
9
19
const mapStateToProps = createSelector (
10
20
commentFormSelector ,
11
21
( commentForm : any ) => commentForm . toJS ( )
@@ -15,5 +25,5 @@ const mapDispatchToProps = (dispatch: Function) => ({
15
25
actions : bindActionCreators ( actions , dispatch ) ,
16
26
} ) ;
17
27
18
- export default ( Component : ReactClass < any > ) : ReactClass < { } > =>
28
+ export default ( Component : ReactClass < AddPropsType > ) : ReactClass < { } > =>
19
29
connect ( mapStateToProps , mapDispatchToProps ) ( Component ) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,23 @@ import { createSelector } from 'reselect';
6
6
import commentsStoreSelector from '../../../selectors/commentsStoreSelector' ;
7
7
import { actions } from '../sagas' ;
8
8
9
+ type CommentType = {
10
+ author ?: string ,
11
+ text ?: string ,
12
+ }
13
+
14
+ export type IndexPropsType = {
15
+ comments : Array < CommentType > ,
16
+ meta : {
17
+ loading : boolean ,
18
+ } ,
19
+ actions : {
20
+ fetch : ( ) => void ,
21
+ updateForm : ( payload : Object ) => void ,
22
+ createComment : ( payload : Object ) => void ,
23
+ }
24
+ }
25
+
9
26
const mapStateToProps = createSelector (
10
27
commentsStoreSelector ,
11
28
( commentsStore : any ) => ( {
@@ -18,5 +35,5 @@ const mapDispatchToProps = (dispatch: Function) => ({
18
35
actions : bindActionCreators ( actions , dispatch ) ,
19
36
} ) ;
20
37
21
- export default ( Component : ReactClass < any > ) : ReactClass < { } > =>
38
+ export default ( Component : ReactClass < IndexPropsType > ) : ReactClass < { } > =>
22
39
connect ( mapStateToProps , mapDispatchToProps ) ( Component ) ;
Original file line number Diff line number Diff line change 5
5
"scripts" : {
6
6
"start" : " node node_modules/react-native/local-cli/cli.js start" ,
7
7
"test" : " jest" ,
8
- "flow" : " flow" ,
8
+ "flow" : " node_modules/ flow-bin/cli.js " ,
9
9
"lint" : " node_modules/eslint/bin/eslint.js --config .eslintrc.yml app"
10
10
},
11
11
"dependencies" : {
37
37
"eslint-plugin-jsx-a11y" : " ^2.2.3" ,
38
38
"eslint-plugin-react" : " ^6.7.1" ,
39
39
"eslint-plugin-react-native" : " ^2.1.0" ,
40
+ "flow-bin" : " ^0.33.0" ,
40
41
"jest" : " 17.0.3" ,
41
42
"jest-react-native" : " 17.0.3" ,
42
43
"react-test-renderer" : " 15.3.2"
You can’t perform that action at this time.
0 commit comments