zanettin/incompose

View on GitHub
docs/withProps.md

Summary

Maintainability
Test Coverage
# withProps
## Description
Like `defaultProps()`, except the passed props take precedence over props provided to the base component.

## API
```
withProps(
  props : Object
) : Function
```

## Example
```jsx
import {
  compose,
  withProps
} from 'incompose';

const LeaderBoard = (props) => (
  <div>
    <h1>{props.name} has a score of {props.score}</h1>
  </div>
);

export default compose(
  withProps({
    score : 100,
    name  : 'John',
  }),
)(LeaderBoard);
```