Higher Order Component - Props proxy

This basically helps to add/edit props passed to the Component.

  1. function HOC(WrappedComponent) {
  2. return class Test extends Component {
  3. render() {
  4. const newProps = {
  5. title: 'New Header',
  6. footer: false,
  7. showFeatureX: false,
  8. showFeatureY: true
  9. };
  10. return <WrappedComponent {...this.props} {...newProps} />
  11. }
  12. }
  13. }