How to use the number function from prop-types
Find comprehensive JavaScript prop-types.number code examples handpicked from public code repositorys.
168 169 170 171 172 173 174 175 176 177
* cells, i.e. they don't span the full width of your view (as in the * ListViewGridLayoutExample), you should set the pageSize to be a multiple * of the number of cells per row, otherwise you're likely to see gaps at * the edge of the ListView as new pages are loaded. */ pageSize: PropTypes.number.isRequired, /** * () => renderable * * The header and footer are always rendered (if these props are provided)
481
0
231
+ 7 other calls in file
112 113 114 115 116 117 118 119 120 121
// is shown if the prop isn't provided. // An object taking on a particular shape optionalObjectWithShape: PropTypes.shape({ optionalProperty: PropTypes.string, requiredProperty: PropTypes.number.isRequired }), // An object with warnings on extra properties optionalObjectWithStrictShape: PropTypes.exact({
388
0
59
+ 11 other calls in file
86 87 88 89 90 91 92 93 94 95
optionalObjectOf: PropTypes.objectOf(PropTypes.number), // An object taking on a particular shape optionalObjectWithShape: PropTypes.shape({ color: PropTypes.string, fontSize: PropTypes.number }), // You can chain any of the above with `isRequired` to make sure a warning // is shown if the prop isn't provided.
388
0
3
20 21 22 23 24 25 26 27 28 29
maxHeight: PropTypes.number, maxWidth: PropTypes.number, minHeight: PropTypes.number, minWidth: PropTypes.number, ratioHeight: PropTypes.number, ratioWidth: PropTypes.number }), maxFileSize: PropTypes.number, onFileAdd: PropTypes.func.isRequired, onFileRemove: PropTypes.func.isRequired,
61
78
23
GitHub: szhsin/react-menu
1452 1453 1454 1455 1456 1457 1458 1459 1460 1461
}); process.env.NODE_ENV !== "production" ? ControlledMenu.propTypes = /*#__PURE__*/_extends({}, rootMenuPropTypes, { state: /*#__PURE__*/propTypes.oneOf( /*#__PURE__*/values(MenuStateMap)), anchorPoint: /*#__PURE__*/propTypes.exact({ x: propTypes.number, y: propTypes.number }), anchorRef: propTypes.object, skipOpen: propTypes.object, captureFocus: propTypes.bool,
48
883
6
+ 2 other calls in file
GitHub: steedos/steedos-unpkg
857 858 859 860 861 862 863 864 865 866
// code uri: PropTypes.string, // images integrity: PropTypes.string.isRequired, language: PropTypes.string.isRequired, size: PropTypes.number.isRequired }).isRequired }; }
0
1
0
912 913 914 915 916 917 918 919 920 921 922
} Suggestion.propTypes = { id: PropTypes.string.isRequired, query: PropTypes.string.isRequired, index: PropTypes.number.isRequired, ignoreAccents: PropTypes.bool, suggestion: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, display: PropTypes.string
0
0
3
+ 3 other calls in file
GitHub: neiht13/nksx
251 252 253 254 255 256 257 258 259 260
src: PropTypes.string.isRequired, height: PropTypes.number.isRequired, width: PropTypes.number.isRequired, excavate: PropTypes.bool, x: PropTypes.number, y: PropTypes.number }) } : {}; var MARGIN_SIZE = 2; // This is *very* rough estimate of max amount of QRCode allowed to be covered. // It is "wrong" in a lot of ways (area is a terrible way to estimate, it
0
0
1
+ 26 other calls in file
175 176 177 178 179 180 181 182 183 184 185
); } } CommentMessage.propTypes = { actorId: PropTypes.number.isRequired, actorUsername: PropTypes.string.isRequired, className: PropTypes.string, commentDateTime: PropTypes.string.isRequired, commentId: PropTypes.number.isRequired,
0
0
1
+ 11 other calls in file
GitHub: iustins/online-shop
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283
className: PropTypes.node, children: PropTypes.node, navbar: PropTypes.bool, delay: PropTypes.oneOfType([PropTypes.shape({ show: PropTypes.number, hide: PropTypes.number }), PropTypes.number]), onOpened: PropTypes.func, onClosed: PropTypes.func };
0
0
1
+ 84 other calls in file
1892 1893 1894 1895 1896 1897 1898 1899 1900 1901
if (getItemLayout) { frame = getItemLayout(data, index); if (__DEV__) { const frameType = PropTypes.shape({ length: PropTypes.number.isRequired, offset: PropTypes.number.isRequired, index: PropTypes.number.isRequired, }).isRequired; PropTypes.checkPropTypes( {frame: frameType},
0
0
1
+ 5 other calls in file
393 394 395 396 397 398 399 400 401 402
/** * The start and end of the text input's selection. Set start and end to * the same value to position the cursor. */ selection: (PropTypes.shape({ start: PropTypes.number.isRequired, end: PropTypes.number, }): React$PropType$Primitive<{ end?: number, start: number,
0
0
1
GitHub: romibi/CodingTrain
26 27 28 29 30 31 32 33 34 35
items: PropTypes.arrayOf(PropTypes.shape(link)).isRequired, }); const videoBase = module.exports.videoBase = exact({ title: PropTypes.string.isRequired, video_number: PropTypes.number.isRequired, date: PropTypes.instanceOf(Date).isRequired, video_id: PropTypes.string, live_example: PropTypes.oneOfType([ PropTypes.string,
0
0
2
prop-types.default is the most popular function in prop-types (2947 examples)