0.2.0 • Published 9 years ago

react-props-decorators v0.2.0

Weekly downloads
30
License
MIT
Repository
github
Last release
9 years ago

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