-
Notifications
You must be signed in to change notification settings - Fork 3k
/
propTypes.js
42 lines (33 loc) · 1.38 KB
/
propTypes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import PropTypes from 'prop-types';
const propTypes = {
/** Array of additional styles to add */
style: PropTypes.arrayOf(PropTypes.object),
/** Returns a function as a child to pass insets to or a node to render without insets */
children: PropTypes.oneOfType([
PropTypes.node,
PropTypes.func,
]).isRequired,
/** Whether to include padding bottom */
includePaddingBottom: PropTypes.bool,
/** Whether to include padding top */
includePaddingTop: PropTypes.bool,
// Called when navigated Screen's transition is finished.
onTransitionEnd: PropTypes.func,
/** The behavior to pass to the KeyboardAvoidingView, requires some trial and error depending on the layout/devices used.
* Search 'switch(behavior)' in ./node_modules/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js for more context */
keyboardAvoidingViewBehavior: PropTypes.oneOf(['padding', 'height', 'position']),
/** Details about any modals being used */
modal: PropTypes.shape({
/** Indicates when an Alert modal is about to be visible */
willAlertModalBecomeVisible: PropTypes.bool,
}),
};
const defaultProps = {
style: [],
includePaddingBottom: true,
includePaddingTop: true,
onTransitionEnd: () => {},
modal: {},
keyboardAvoidingViewBehavior: 'padding',
};
export {propTypes, defaultProps};