From 5e5bce02211cb87d0936cda0d34fe5bfb0dbcfdc Mon Sep 17 00:00:00 2001
From: Kuitos <kuitos.lau@gmail.com>
Date: Fri, 25 May 2018 10:13:00 +0800
Subject: [PATCH] fix: make component construct correctly which class extends
 from Vue

---
 flow/vue.flow.js                            | 2 +-
 packages/create-instance/create-instance.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/flow/vue.flow.js b/flow/vue.flow.js
index d7a51d41f..77b9503c0 100644
--- a/flow/vue.flow.js
+++ b/flow/vue.flow.js
@@ -2,6 +2,6 @@
 
 // Importing these types declares them, so they are available globally
 
-declare type Component = Object // eslint-disable-line no-undef
+declare type Component = Object | Function // eslint-disable-line no-undef
 declare type VNode = Object // eslint-disable-line no-undef
 declare type SlotValue = Component | string | Array<Component> | Array<string>
diff --git a/packages/create-instance/create-instance.js b/packages/create-instance/create-instance.js
index 3b807ab7d..c898222f3 100644
--- a/packages/create-instance/create-instance.js
+++ b/packages/create-instance/create-instance.js
@@ -55,7 +55,7 @@ export default function createInstance (
 
   addEventLogger(vue)
 
-  const Constructor = vue.extend(component)
+  const Constructor = (typeof component === 'function' && component.prototype instanceof Vue) ? component : vue.extend(component)
 
   const instanceOptions = { ...options, propsData: { ...options.propsData }}
   deleteoptions(instanceOptions)