{"size": 513, "ext": "js", "max_stars_repo_path": "src/wrapComponent.js", "max_stars_repo_name": "Eiryyy/redux-form-grommet", "max_stars_repo_stars_event_min_datetime": "2018-03-12T17:27:36.000Z", "max_stars_repo_stars_event_max_datetime": "2018-03-12T17:27:36.000Z", "max_issues_repo_path": "src/wrapComponent.js", "max_issues_repo_name": "Eiryyy/redux-form-grommet", "max_issues_repo_issues_event_min_datetime": "2017-10-07T16:28:33.000Z", "max_issues_repo_issues_event_max_datetime": "2017-10-07T16:28:33.000Z", "max_forks_repo_path": "src/wrapComponent.js", "max_forks_repo_name": "Eiryyy/redux-form-binding-grommet", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 25.65, "max_line_length": 82, "alphanum_fraction": 0.6783625731}
import React, { Component } from 'react'

export default function wrapComponent(GrommetComponent, mapProps) {
  class WrappedComponent extends Component {
    getRenderedComponent() {
      return this.grommetComponent
    }

    render() {
      return (
        <GrommetComponent
          ref={component => this.grommetComponent = component}
          {...mapProps(this.props)} />
      )
    }
  }
  WrappedComponent.displayName = `ReduxFormBindingGrommet${GrommetComponent.name}`
  return WrappedComponent
}
