chore: remove unnecessary hooks api

This commit is contained in:
Evan You 2018-11-03 05:28:18 +09:00
parent 8602b61efb
commit 774cce324d
2 changed files with 2 additions and 16 deletions

View File

@ -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<T>(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
}
}
}

View File

@ -22,7 +22,6 @@ export { memoize } from './optional/memoize'
// Experimental APIs
export {
withHooks,
useState,
useEffect,
useRef,