How to use the objectOf function from prop-types
Find comprehensive JavaScript prop-types.objectOf code examples handpicked from public code repositorys.
104 105 106 107 108 109 110 111 112
// 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), // You can chain any of the above with `isRequired` to make sure a warning // is shown if the prop isn't provided.
388
0
59
13 14 15 16 17 18 19 20 21 22 23
const ImageURISourcePropType = PropTypes.shape({ uri: PropTypes.string, bundle: PropTypes.string, method: PropTypes.string, headers: PropTypes.objectOf(PropTypes.string), body: PropTypes.string, cache: PropTypes.oneOf([ 'default', 'reload',
5
3
0
GitHub: steedos/steedos-unpkg
682 683 684 685 686 687 688 689 690 691 692
} if (process.env.NODE_ENV !== 'production') { FolderViewer.propTypes = { path: PropTypes.string.isRequired, details: PropTypes.objectOf(PropTypes.shape({ path: PropTypes.string.isRequired, type: PropTypes.oneOf(['directory', 'file']).isRequired, contentType: PropTypes.string, // file only
0
1
0
GitHub: AquaSet/Scratch
962 963 964 965 966 967 968 969 970 971
projectStudios: PropTypes.arrayOf(PropTypes.object), refreshSession: PropTypes.func, registrationOpen: PropTypes.bool, remixProject: PropTypes.func, remixes: PropTypes.arrayOf(PropTypes.object), replies: PropTypes.objectOf(PropTypes.array), reportProject: PropTypes.func, resetProject: PropTypes.func, sessionStatus: PropTypes.string, setFavedStatus: PropTypes.func.isRequired,
0
0
1
GitHub: AquaSet/Scratch
116 117 118 119 120 121 122 123 124 125 126
isPhone: true } }; ValidatedPhoneInput.propTypes = { validations: PropTypes.objectOf(PropTypes.bool) }; module.exports = ValidatedPhoneInput;
0
0
1
GitHub: nudj/components
18 19 20 21 22 23 24 25 26 27 28 29
} RadioBlockGroup.propTypes = { styles: PropTypes.oneOfType([ PropTypes.array, PropTypes.objectOf(CustomPropTypes.style) ]) } module.exports = RadioBlockGroup
0
0
0
GitHub: nudj/components
61 62 63 64 65 66 67 68 69 70 71
onChange: () => {}, nonsensitive: FS_SHOW } RadioBlock.propTypes = { styleSheet: PropTypes.objectOf(CustomPropTypes.style), checked: PropTypes.bool, onChange: PropTypes.func, id: PropTypes.string.isRequired, name: PropTypes.string.isRequired,
0
0
0
prop-types.default is the most popular function in prop-types (2947 examples)