chore: remove unnecessary hooks api
This commit is contained in:
parent
8602b61efb
commit
774cce324d
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ export { memoize } from './optional/memoize'
|
||||
|
||||
// Experimental APIs
|
||||
export {
|
||||
withHooks,
|
||||
useState,
|
||||
useEffect,
|
||||
useRef,
|
||||
|
Loading…
Reference in New Issue
Block a user