How to use the bool function from prop-types
Find comprehensive JavaScript prop-types.bool code examples handpicked from public code repositorys.
201 202 203 204 205 206 207 208 209
However, code like this will not work with the `prop-types` package: ```js // Will not work with `prop-types` package! var errorOrNull = PropTypes.bool(42, 'myProp', 'MyComponent', 'prop'); ``` It will throw an error:
+ 3 other calls in file
180 181 182 183 184 185 186 187 188 189
); }; User.propTypes = { user: PropTypes.shapeImmutable({ isLoading: PropTypes.bool.isRequired, data: PropTypes.shape({ name: PropTypes.string.isRequired, age: PropTypes.number, birthdate: PropTypes.string,
+ 3 other calls in file
225 226 227 228 229 230 231 232 233 234
target: _propTypes.string, separator: _propTypes.string, filename: _propTypes.string, uFEFF: _propTypes.bool, onClick: _propTypes.func, asyncOnClick: _propTypes.bool }; var defaultProps = exports.defaultProps = { separator: ',',
223 224 225 226 227 228 229 230 231 232
data: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.array]).isRequired, headers: _propTypes.array, target: _propTypes.string, separator: _propTypes.string, filename: _propTypes.string, uFEFF: _propTypes.bool }; var defaultProps = exports.defaultProps = { separator: ',',
GitHub: szhsin/react-menu
302 303 304 305 306 307 308 309 310 311
viewScroll: /*#__PURE__*/propTypes.oneOf(['auto', 'close', 'initial']), submenuOpenDelay: propTypes.number, submenuCloseDelay: propTypes.number, portal: /*#__PURE__*/propTypes.oneOfType([propTypes.bool, /*#__PURE__*/propTypes.exact({ target: propTypes.object, stablePosition: propTypes.bool })]), theming: propTypes.string, onItemClick: propTypes.func });
+ 14 other calls in file
35 36 37 38 39 40 41 42 43 44
key: 'render', value: function render() { var propTypes = { site: PropTypes.shape({ running: PropTypes.bool.isRequired, loading: PropTypes.bool.isRequired, disconnected: PropTypes.bool, prevOutput: PropTypes.array, prevError: PropTypes.string, hasOutput: PropTypes.bool,
GitHub: jimczj/issue-helper
![jimczj profile picture](/jimczj.png?size=40)
44 45 46 47 48 49 50 51 52 53
title: stringType, formItems: PropTypes.arrayOf(PropTypes.shape({ label: stringType, mdTitle: PropTypes.string, type: PropTypes.oneOf(['textarea', 'version', 'code', 'input']).isRequired, required: PropTypes.bool })) }) const configPropTypes = {
72 73 74 75 76 77 78 79 80 81 82
* this is essentially children. However we can't use children because then * using `wrapper.setProps({ children })` would work differently if this component * would be the root. */ __element: PropTypes.element.isRequired, __strict: PropTypes.bool.isRequired } : void 0; var warnedOnce = false; // Generate an enhanced mount function. function createMount() {
+ 3 other calls in file
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
left: PropTypes.number, right: PropTypes.number, top: PropTypes.number, scrollFocusedIntoView: PropTypes.bool, isLoading: PropTypes.bool, isOpened: PropTypes.bool.isRequired, onSelect: PropTypes.func, ignoreAccents: PropTypes.bool, customSuggestionsContainer: PropTypes.func, containerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
+ 11 other calls in file
1304 1305 1306 1307 1308 1309 1310 1311 1312
* DropdownContext * { * toggle: PropTypes.func.isRequired, * isOpen: PropTypes.bool.isRequired, * direction: PropTypes.oneOf(['up', 'down', 'start', 'end']).isRequired, * inNavbar: PropTypes.bool.isRequired, * disabled: PropTypes.bool * } */
+ 2 other calls in file
GitHub: iustins/online-shop
4179 4180 4181 4182 4183 4184 4185 4186 4187 4188
d_attributes: PropTypes.object.isRequired, d_key: PropTypes.string.isRequired, d_role: PropTypes.string.isRequired, d_tabIndex: PropTypes.string.isRequired, d_tag: PropTypes.any.isRequired, isOpen: PropTypes.bool.isRequired, children: PropTypes.node.isRequired, d_classes: PropTypes.string }; DropdownMenuProComponent.defaultProps = {
+ 369 other calls in file
GitHub: AquaSet/Scratch
993 994 995 996 997 998 999 1000 1001 1002 1003
censored: PropTypes.bool, censoredByAdmin: PropTypes.bool, censoredByCommunity: PropTypes.bool, message: PropTypes.string, deleted: PropTypes.bool, reshareable: PropTypes.bool }) }; Preview.defaultProps = {
GitHub: AquaSet/Scratch
100 101 102 103 104 105 106 107 108 109 110
name: PropTypes.string, onChange: PropTypes.func, onSetValue: PropTypes.func, showErrors: PropTypes.bool, updateOnBlur: PropTypes.bool, updateOnChange: PropTypes.bool }; const phoneValidationHOC = validationHOCFactory({ isPhone: <intl.FormattedMessage id="teacherRegistration.validationPhoneNumber" />
27 28 29 30 31 32 33 34 35 36
class App extends React.Component { static get propTypes() { return Object.assign({}, CustomizationOptionUrlPropTypes, HostSettingsUrlPropTypes, { customizationOptions: ConfigurationType, hostSettings: PropTypes.object.isRequired, internalPreview: PropTypes.bool.isRequired, selectWidget: PropTypes.func.isRequired, selectedWidget: WidgetType, selectedWidgetQuery: PropTypes.string, setCustomizationOption: PropTypes.func.isRequired,
+ 7 other calls in file
400 401 402 403 404 405 406 407 408 409 410
} } } FormControls.propTypes = { createButton: PropTypes.bool , perspective: PropTypes.shape( SerialisedPerspective ).isRequired , contextinstance: PropTypes.string.isRequired , roleinstance: PropTypes.string , myroletype: PropTypes.string.isRequired
+ 2 other calls in file
186 187 188 189 190 191 192 193 194 195 196 197
} TableControls.contextType = PSContext; TableControls.propTypes = { createButton: PropTypes.bool.isRequired , perspective: PropTypes.shape( SerialisedPerspective ).isRequired // This is the row that is selected in the table, possibly none. , selectedroleinstance: PropTypes.string };
+ 2 other calls in file
395 396 397 398 399 400 401 402 403 404
title: PropTypes.string, links: PropTypes.arrayOf(PropTypes.shape({ to: PropTypes.string.isRequired, name: PropTypes.string.isRequired })).isRequired, bullets: PropTypes.bool }; LinkList.defaultProps = { bullets: false };
+ 11 other calls in file
GitHub: nudj/components
68 69 70 71 72 73 74 75 76 77
onChange: PropTypes.func, id: PropTypes.string.isRequired, name: PropTypes.string.isRequired, value: PropTypes.string.isRequired, label: PropTypes.node, nonsensitive: PropTypes.bool } module.exports = RadioBlock
prop-types.default is the most popular function in prop-types (2947 examples)