UNPKG

is-class-component

Version:
23 lines (17 loc) 604 B
'use strict'; var isItType = require('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 isItType.isFunction(input) && !!(input.prototype && input.prototype.isReactComponent); } module.exports = isClassComponent; //# sourceMappingURL=is-class-component.js.map