google-map-react/develop/utils/isReferentiallyTransparentFunctionComponent.js
Ivan Starkov 07368e23ad Move 2 yarn, add prettier, update linters (#360)
* Move 2 yarn, add prettier, update linters

* Fix linting error
2017-04-11 00:47:54 +03:00

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;