Skip to content

popkirby/react-props-decorators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Define props of React components by ES7 decorators

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published