项目作者: brendon1555

项目描述 :
Extra prop type validators for React
高级语言: TypeScript
项目地址: git://github.com/brendon1555/extra-prop-types.git
创建时间: 2020-03-14T02:49:42Z
项目社区:https://github.com/brendon1555/extra-prop-types

开源协议:MIT License

下载


Extra Prop Types

Extra Prop Types for React Components

GitHub issues
devDependencies
peerDependencies
License


Installation

  1. $ yarn add extra-prop-types

or

  1. $ npm install --save extra-prop-types

Usage

  1. import * as ExtraPropTypes from 'extra-prop-types';
  2. const SomeComponent = (colorProp) => (
  3. <div style={{ backgroundColor: colorProp }}></div>
  4. )
  5. SomeComponent.propTypes = {
  6. colorProp: ExtraPropTypes.color.isRequired
  7. }

Types

color
accepts:

  • hex
    • ffffff

  • rgb
    • rgb(255, 255, 255)
  • rgba
    • rgba(255, 255, 255, 1)
  • hsl
    • hsl(0, 100%, 100%)
  • hsla
    • hsla(0, 0%, 100%, 1)

Contributing

Want to add a type? To get started…

Step 1

  • Option 1

    • 🍴 Fork this repo!
  • Option 2

    • 👯 Clone this repo to your local machine using https://github.com/brendon1555/extra-prop-types.git

Step 2

  • HACK AWAY! 🔨🔨🔨

Step 3


Contributors

Brendon Lees
Brendon1555
github.com/brendon1555

Support

Reach out to me at one of the following places!


License

License