UNPKG

is-class-component

Version:
21 lines (16 loc) 581 B
import { isFunction } from 'is-it-type'; /* -------------------- * is-class-component module * Entry point * ------------------*/ /** * Determine if input is a React class component. * Input must have already been checked that it's a function before calling this. * @param {Function} Component - Function * @return {boolean} - true if is a React class component */ function isClassComponent(input) { return isFunction(input) && !!(input.prototype && input.prototype.isReactComponent); } export default isClassComponent; //# sourceMappingURL=is-class-component.js.map