From 774cce324d7b12b3db82b6f18e911bea36f9424a Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 3 Nov 2018 05:28:18 +0900 Subject: [PATCH] chore: remove unnecessary hooks api --- packages/runtime-core/src/experimental/hooks.ts | 17 ++--------------- packages/runtime-core/src/index.ts | 1 - 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/runtime-core/src/experimental/hooks.ts b/packages/runtime-core/src/experimental/hooks.ts index b4948d3b..f667b5d2 100644 --- a/packages/runtime-core/src/experimental/hooks.ts +++ b/packages/runtime-core/src/experimental/hooks.ts @@ -1,6 +1,5 @@ -import { ComponentInstance, FunctionalComponent, Component } from '../component' -import { mergeLifecycleHooks, Data, WatchOptions } from '../componentOptions' -import { VNode, Slots } from '../vdom' +import { ComponentInstance } from '../component' +import { mergeLifecycleHooks, WatchOptions } from '../componentOptions' import { observable, computed } from '@vue/observer' import { setupWatcher } from '../componentWatch' @@ -200,15 +199,3 @@ export function useComputed(getter: () => T): T { } return handles[id]() } - -export function withHooks(render: FunctionalComponent): new () => Component { - return class ComponentWithHooks extends Component { - static displayName = render.name - render(props: Data, slots: Slots, attrs: Data, parentVNode: VNode) { - setCurrentInstance((this as any)._self) - const ret = render(props, slots, attrs, parentVNode) - unsetCurrentInstance() - return ret - } - } -} diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index f038318d..47b9c81d 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -22,7 +22,6 @@ export { memoize } from './optional/memoize' // Experimental APIs export { - withHooks, useState, useEffect, useRef,