src/ReferenceableContainer.jsx
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>
)
}
}
}