Skip to content

Commit 8e02af4

Browse files
authored
Merge pull request #32 from nmjay/master
Update RN 0.48.x PropTypes
2 parents f9a42b9 + 5b4c7ad commit 8e02af4

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

index.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,31 @@ import {
1111
} from 'react-native'
1212

1313
class Modal extends Component {
14+
15+
static propTypes = {
16+
open: PropTypes.bool,
17+
offset: PropTypes.number,
18+
overlayBackground: PropTypes.string,
19+
animationDuration: PropTypes.number,
20+
animationTension: PropTypes.number,
21+
modalDidOpen: PropTypes.func,
22+
modalDidClose: PropTypes.func,
23+
closeOnTouchOutside: PropTypes.bool,
24+
disableOnBackPress: PropTypes.bool,
25+
};
26+
27+
static defaultProps = {
28+
open: false,
29+
offset: 0,
30+
overlayBackground: 'rgba(0, 0, 0, 0.75)',
31+
animationDuration: 200,
32+
animationTension: 40,
33+
modalDidOpen: () => undefined,
34+
modalDidClose: () => undefined,
35+
closeOnTouchOutside: true,
36+
disableOnBackPress: false,
37+
};
38+
1439
constructor() {
1540
super();
1641

@@ -151,31 +176,6 @@ class Modal extends Component {
151176
}
152177
}
153178

154-
Modal.propTypes = {
155-
open: PropTypes.bool,
156-
offset: PropTypes.number,
157-
overlayBackground: PropTypes.string,
158-
animationDuration: PropTypes.number,
159-
animationTension: PropTypes.number,
160-
modalDidOpen: PropTypes.func,
161-
modalDidClose: PropTypes.func,
162-
closeOnTouchOutside: PropTypes.bool,
163-
disableOnBackPress: PropTypes.bool,
164-
};
165-
166-
Modal.defaultProps = {
167-
open: false,
168-
offset: 0,
169-
overlayBackground: 'rgba(0, 0, 0, 0.75)',
170-
animationDuration: 200,
171-
animationTension: 40,
172-
modalDidOpen: () => undefined,
173-
modalDidClose: () => undefined,
174-
closeOnTouchOutside: true,
175-
disableOnBackPress: false,
176-
};
177-
178-
179179
const styles = StyleSheet.create({
180180
absolute: {
181181
position: 'absolute',

0 commit comments

Comments
 (0)