gab-social/app/javascript/gabsocial/features/ui/util/wrapped_bundle.js
mgabdev 43e384554c Remove React, PureComponent global import, added those imports to files directly
• Remove:
- React, PureComponent global import and added those imports to files directly
2020-08-17 15:07:16 -05:00

39 lines
729 B
JavaScript

import React from 'react'
import Bundle from './bundle'
class WrappedBundle extends React.PureComponent {
render() {
const {
component,
componentParams,
errorComponent,
loadingComponent,
} = this.props
return (
<Bundle
fetchComponent={component}
loading={loadingComponent}
error={errorComponent}
>
{
Component =>
(
<Component {...componentParams} />
)
}
</Bundle>
)
}
}
WrappedBundle.propTypes = {
component: PropTypes.func.isRequired,
componentParams: PropTypes.object,
errorComponent: PropTypes.object,
loadingComponent: PropTypes.object,
}
export default WrappedBundle