Skip to content

Commit

Permalink
Enable flowtype for generatorFunction.js
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKVal committed Aug 22, 2016
1 parent 7cac593 commit a07244e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions node_package/src/generatorFunction.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @flow

// See discussion:
// https://discuss.reactjs.org/t/how-to-determine-if-js-object-is-react-component/2825/2

Expand All @@ -7,12 +9,11 @@
* @param component
* @returns {boolean}
*/
export default function generatorFunction(component) {
export default function generatorFunction(component: any) {
if (!component.prototype) {
return false;
}

// es5 or es6 React Component
const es5OrEs6ReactComponent = component.prototype.isReactComponent;
return !es5OrEs6ReactComponent;
return !component.prototype.isReactComponent;
}

0 comments on commit a07244e

Please sign in to comment.