Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
prop-types-docs
Advanced tools
yarn add prop-types-docs
npm install prop-types-docs
const MyComponent = ({ name, age, contacts }) => {
<div>
name: {name}
age: {age}
contacts: {contacts.map(() => ...)}
</div>
}
import PropTypes, { withPropDocs } from 'prop-types-docs'
export default withPropDocs({
name: 'MyComponent', // optional
props: {
name: {
type: PropTypes.string,
required: true,
description: "The user's name",
},
age: {
type: PropTypes.number,
required: true,
description: "The user's age",
},
contacts: {
type: PropTypes.array,
default: [],
description: 'A list of contacts',
},
},
})(MyComponent)
import PropTypes from 'prop-types'
MyComponent.displayName = 'MyComponent'
MyComponent.propTypes = {
name: PropTypes.string.isRequired,
age: PropTypes.number.isRequired,
contacts: PropTypes.array,
}
MyComponent.defaultProps = {
contacts: [],
}
prop-types-docs
is not a higher order component. It simply assigns the .propTypes
and .defaultProps
on the provided component. This also allows it to be used anywhere in a compose chain.
In addition to setting the prop types, it also stores the props
meta object on the .propInfo
key on the provided component.
Better support for complex proptypes, e.g. arrayOf(shape())
.
FAQs
### Document your prop types!
The npm package prop-types-docs receives a total of 207 weekly downloads. As such, prop-types-docs popularity was classified as not popular.
We found that prop-types-docs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.