Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 421 Bytes

bindProps.md

File metadata and controls

30 lines (24 loc) · 421 Bytes

@bindProps(props: Object)

Bind the given props to the decorated component.

Example

@bindProps({
  foo: 'bar',
})
class Foo extends React.Component {

  static contextTypes = {
    foo: PropTypes.string,
  }

  static defaultProps = {
    foo: 'lorem ipsum dolor...',
  }

  render() {
    return (
      <div>
        {/* this is equal to 'bar' */}
        {this.props.foo}
      </div>
    );
  }
}