cellog/react-selection

View on GitHub
src/ReferenceableContainer.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React, { PropTypes } from 'react'

export default function makeReferenceableContainer(Component, componentDisplayName) {
  return class extends React.Component {
    static displayName = `ReferenceableContainer(${componentDisplayName})`
    static propTypes = {
      children: PropTypes.any
    }
    render() {
      const { children, ...props } = this.props
      return (
        <Component {...props}>
          {children}
        </Component>
      )
    }
  }
}