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

Readme

Keywords

none

Package Sidebar

Install

npm i react-props-decorators

Weekly Downloads

112

Version

0.2.0

License

MIT

Last publish

Collaborators

  • popkirby