Have ideas to improve npm?Join in the discussion! »

    react-props-decorators
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/react-props-decorators package

    0.2.0 • Public • Published

    react-props-decorators

    Define Component.propTypes and Component.defaultProps by ES7 decorators.

    Installation

    npm install react-props-decorators
    

    Usage

    import React from 'react';
    import { propTypes, defaultProps } from 'react-props-decorators';
     
    @propTypes({
      foo: React.PropTypes.string,
      bar: React.PropTypes.number
    })
    @defaultProps({
      foo: "defaultString",
      bar: 100
    })
    class Baz extends React.Component {
      /* ... */
    }

    License

    MIT

    Keywords

    none

    Install

    npm i react-props-decorators

    DownloadsWeekly Downloads

    63

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • avatar