* @internal
*/
export { initFeatureFlags } from './featureFlags'
+/**
+ * @internal
+ */
+export {
+ createAsyncComponentContext,
+ useAsyncComponentState,
+ isAsyncWrapper,
+} from './apiAsyncComponent'
+/**
+ * @internal
+ */
+export { markAsyncBoundary } from './helpers/useId'
+ /**
+ * @internal
+ */
+ export { createInternalObject } from './internalObject'
): NodeRef | undefined {
if (!instance || instance.isUnmounted) return
+ const isVaporComp = isVaporComponent(el)
+ if (isVaporComp && isAsyncWrapper(el as VaporComponentInstance)) {
+ const i = el as VaporComponentInstance
+ const frag = i.block as DynamicFragment
+ // async component not resolved yet
+ if (!i.type.__asyncResolved) {
+ frag.setRef = i => setRef(instance, i, ref, oldRef, refFor)
+ return
+ }
+
+ // set ref to the inner component instead
+ el = frag.nodes as VaporComponentInstance
+ }
+
const setupState: any = __DEV__ ? instance.setupState || {} : null
- const refValue = isVaporComp
- ? getExposed(el as VaporComponentInstance) || el
- : el
+ const refValue = getRefValue(el)
const refs =
instance.refs === EMPTY_OBJ ? (instance.refs = {}) : instance.refs