Like defaultProps()
, except the passed props take precedence over props provided to the base component.
withProps(
props : Object
) : Function
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);