How to use the arrayOf function from prop-types

Find comprehensive JavaScript prop-types.arrayOf code examples handpicked from public code repositorys.

231
232
233
234
235
236
237
238
239
 * top of the screen when scrolling. For example, passing
 * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the
 * top of the scroll view. This property is not supported in conjunction
 * with `horizontal={true}`.
 */
stickyHeaderIndices: PropTypes.arrayOf(PropTypes.number).isRequired,
/**
 * Flag indicating whether empty section headers should be rendered. In the future release
 * empty section headers will be rendered by default, and the flag will be deprecated.
fork icon481
star icon0
watch icon231

78
79
80
81
82
83
84
85
86
  PropTypes.number,
  PropTypes.instanceOf(Message)
]),

// An array of a certain type
optionalArrayOf: PropTypes.arrayOf(PropTypes.number),

// An object with property values of a certain type
optionalObjectOf: PropTypes.objectOf(PropTypes.number),
fork icon388
star icon0
watch icon3

+ 3 other calls in file

66
67
68
69
70
71
72
73
74
75

MetaRow.propTypes = {
    className: PropTypes.string,
    title: PropTypes.string,
    message: PropTypes.string,
    items: PropTypes.arrayOf(PropTypes.shape({
        posterShape: PropTypes.string
    })),
    itemComponent: PropTypes.elementType,
    deepLinks: PropTypes.shape({
fork icon129
star icon506
watch icon31

+ 3 other calls in file

90
91
92
93
94
95
96
97
98
99
};

Router.propTypes = {
    className: PropTypes.string,
    onPathNotMatch: PropTypes.func,
    viewsConfig: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.exact({
        regexp: PropTypes.instanceOf(RegExp).isRequired,
        urlParamsNames: PropTypes.arrayOf(PropTypes.string).isRequired,
        component: PropTypes.elementType.isRequired
    }))).isRequired
fork icon129
star icon502
watch icon31

+ 3 other calls in file

40
41
42
43
44
45
46
47
48
49
  })
])

const formType = PropTypes.shape({
  title: stringType,
  formItems: PropTypes.arrayOf(PropTypes.shape({
    label: stringType,
    mdTitle: PropTypes.string,
    type: PropTypes.oneOf(['textarea', 'version', 'code', 'input']).isRequired,
    required: PropTypes.bool
fork icon0
star icon4
watch icon2

6
7
8
9
10
11
12
13
14
15

const ShopifyConfigTypes = {
  apiKey: PropTypes.string.isRequired,
  host: PropTypes.string.isRequired,
  secret: PropTypes.string.isRequired,
  scope: PropTypes.arrayOf(PropTypes.string).isRequired,
  afterAuth: PropTypes.func.isRequired,
  shopStore: PropTypes.object,
  accessMode: PropTypes.oneOf(['offline', 'online'])
};
fork icon87
star icon0
watch icon1

31
32
33
34
35
36
37
38
39
40
const ImageSourcePropType = PropTypes.oneOfType([
  ImageURISourcePropType,
  // Opaque type returned by require('./image.jpg')
  PropTypes.number,
  // Multiple sources
  PropTypes.arrayOf(ImageURISourcePropType),
]);


module.exports = ImageSourcePropType;
fork icon5
star icon3
watch icon0

851
852
853
854
855
856
857
858
859
860
if (process.env.NODE_ENV !== 'production') {
  FileViewer.propTypes = {
    path: PropTypes.string.isRequired,
    details: PropTypes.shape({
      contentType: PropTypes.string.isRequired,
      highlights: PropTypes.arrayOf(PropTypes.string),
      // code
      uri: PropTypes.string,
      // images
      integrity: PropTypes.string.isRequired,
fork icon0
star icon1
watch icon0

+ 2 other calls in file

913
914
915
916
917
918
919
920
921
922
canSave: PropTypes.bool,
canShare: PropTypes.bool,
canToggleComments: PropTypes.bool,
canUseBackpack: PropTypes.bool,
cloudHost: PropTypes.string,
comments: PropTypes.arrayOf(PropTypes.object),
enableCommunity: PropTypes.bool,
faved: PropTypes.bool,
favedLoaded: PropTypes.bool,
fullScreen: PropTypes.bool,
fork icon0
star icon0
watch icon1

+ 2 other calls in file

92
93
94
95
96
97
98
99
100
101
102


PhoneInput.propTypes = {
    className: PropTypes.string,
    defaultCountry: PropTypes.string,
    disabled: PropTypes.bool,
    errorMessages: PropTypes.arrayOf(PropTypes.node),
    help: PropTypes.string,
    id: PropTypes.string,
    name: PropTypes.string,
    onChange: PropTypes.func,
fork icon0
star icon0
watch icon1

1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
  }))));
};


DataTableHead.propTypes = {
  color: PropTypes.string,
  columns: PropTypes.arrayOf(PropTypes.object),
  handleSort: PropTypes.func,
  scrollX: PropTypes.bool,
  scrollY: PropTypes.bool,
  sortable: PropTypes.bool,
fork icon0
star icon0
watch icon1

+ 109 other calls in file

14
15
16
17
18
19
20
21
22
23
      id: "money-div"
    }, getMoney(collections));
  }
}
_defineProperty(MoneyDiv, "propTypes", {
  collections: PropTypes.arrayOf(PropTypes.object)
});
module.exports = {
  MoneyDiv
};
fork icon0
star icon0
watch icon2

518
519
520
521
522
523
524
525
526
527
 *
 * @platform ios
 */
dataDetectorTypes: (PropTypes.oneOfType([
  PropTypes.oneOf(DataDetectorTypes),
  PropTypes.arrayOf(PropTypes.oneOf(DataDetectorTypes)),
]): React$PropType$Primitive<
  | 'phoneNumber'
  | 'link'
  | 'address'
fork icon0
star icon0
watch icon1

870
871
872
873
874
875
876
877
878
879
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
defaultTitle: PropTypes.string,
defer: PropTypes.bool,
encodeSpecialCharacters: PropTypes.bool,
htmlAttributes: PropTypes.object,
link: PropTypes.arrayOf(PropTypes.object),
meta: PropTypes.arrayOf(PropTypes.object),
noscript: PropTypes.arrayOf(PropTypes.object),
onChangeClientState: PropTypes.func,
script: PropTypes.arrayOf(PropTypes.object),
fork icon0
star icon0
watch icon1

+ 19 other calls in file

87
88
89
90
91
92
93
94
95
96
}

// Always returns an object with this shape:
// PropTypes.shape(
//   { values: PropTypes.arrayOf( PropTypes.string ).isRequired
//   , propertyVerbs: PropTypes.arrayOf( PropTypes.string).isRequired
//   })
findValues( propId )
{
  const component = this;
fork icon0
star icon0
watch icon1

+ 8 other calls in file

640
641
642
643
644
645
646
647
648
649
ZoomableGroup.propTypes = {
  center: PropTypes.array,
  zoom: PropTypes.number,
  minZoom: PropTypes.number,
  maxZoom: PropTypes.number,
  translateExtent: PropTypes.arrayOf(PropTypes.array),
  onMoveStart: PropTypes.func,
  onMove: PropTypes.func,
  onMoveEnd: PropTypes.func,
  className: PropTypes.string
fork icon0
star icon0
watch icon0

391
392
393
394
395
396
397
398
399
400
401
  return React.createElement("div", null, navigationHeading, linkListItems);
}


LinkList.propTypes = {
  title: PropTypes.string,
  links: PropTypes.arrayOf(PropTypes.shape({
    to: PropTypes.string.isRequired,
    name: PropTypes.string.isRequired
  })).isRequired,
  bullets: PropTypes.bool
fork icon0
star icon0
watch icon0

+ 3 other calls in file

21
22
23
24
25
26
27
28
29
30
  author: link.author.isRequired,
});

const customSection = module.exports.customSection = exact({
  title: PropTypes.string.isRequired,
  items: PropTypes.arrayOf(PropTypes.shape(link)).isRequired,
});

const videoBase = module.exports.videoBase = exact({
  title: PropTypes.string.isRequired,
fork icon0
star icon0
watch icon2

+ 17 other calls in file