mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
18 lines
476 B
JavaScript
18 lines
476 B
JavaScript
const isClassComponent = Component =>
|
|
Boolean(
|
|
Component &&
|
|
Component.prototype &&
|
|
typeof Component.prototype.isReactComponent === 'object'
|
|
);
|
|
|
|
const isReferentiallyTransparentFunctionComponent = Component =>
|
|
Boolean(
|
|
typeof Component === 'function' &&
|
|
!isClassComponent(Component) &&
|
|
!Component.defaultProps &&
|
|
!Component.contextTypes &&
|
|
!Component.propTypes
|
|
);
|
|
|
|
export default isReferentiallyTransparentFunctionComponent;
|