[feature]Maybe we can provide createElement in hooks, to cache the created vdom? Or just passing instance into hooks?
TotooriaHyperion opened this issue · comments
Because the hooks are run in beforeMount where the instance object is already created.
We know that createElement is bound to the instance, so may I assume that meanwhile we can createElement and cache the result?
The API might looks like
hooks(props, instance) {
const h = instance.$createElement;
const cachedVNode = useMemo(....); // some custom hook
return {
cachedVNode,
};
},