diff --git a/dist/vuera.cjs.js b/dist/vuera.cjs.js index a96c6ae..5011178 100644 --- a/dist/vuera.cjs.js +++ b/dist/vuera.cjs.js @@ -407,6 +407,7 @@ var ReactWrapper = { }; function isReactComponent(component) { + if (!component) return false; if ((typeof component === 'undefined' ? 'undefined' : _typeof(component)) === 'object' && !isReactForwardReference(component)) { return false; } diff --git a/dist/vuera.es.js b/dist/vuera.es.js index 7303e2e..5e23f0b 100644 --- a/dist/vuera.es.js +++ b/dist/vuera.es.js @@ -401,6 +401,7 @@ var ReactWrapper = { }; function isReactComponent(component) { + if (!component) return false; if ((typeof component === 'undefined' ? 'undefined' : _typeof(component)) === 'object' && !isReactForwardReference(component)) { return false; } diff --git a/dist/vuera.iife.js b/dist/vuera.iife.js index 7a93c1d..be895d6 100644 --- a/dist/vuera.iife.js +++ b/dist/vuera.iife.js @@ -404,6 +404,7 @@ var ReactWrapper = { }; function isReactComponent(component) { + if (!component) return false; if ((typeof component === 'undefined' ? 'undefined' : _typeof(component)) === 'object' && !isReactForwardReference(component)) { return false; } diff --git a/src/utils/isReactComponent.js b/src/utils/isReactComponent.js index 2ef847d..3387457 100644 --- a/src/utils/isReactComponent.js +++ b/src/utils/isReactComponent.js @@ -1,4 +1,5 @@ export default function isReactComponent (component) { + if (!component) return false if (typeof component === 'object' && !isReactForwardReference(component)) { return false } diff --git a/tests/utils/isReactComponent-test.js b/tests/utils/isReactComponent-test.js index 9ea97a8..40b68b8 100644 --- a/tests/utils/isReactComponent-test.js +++ b/tests/utils/isReactComponent-test.js @@ -20,4 +20,10 @@ describe('isReactComponent', () => { expect(isReactComponent(VueRegisteredComponent)).toBe(false) expect(isReactComponent(VueSingleFileComponent)).toBe(false) }) + + it('returns false for blank input', () => { + expect(isReactComponent(false)).toBe(false) + expect(isReactComponent(null)).toBe(false) + expect(isReactComponent(undefined)).toBe(false) + }) })