Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/runtime-vapor/src/apiTemplateRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@vue/runtime-dom'
import {
EMPTY_OBJ,
hasOwn,
NO,
isArray,
isFunction,
isString,
Expand Down Expand Up @@ -80,12 +80,12 @@ export function setRef(
const refs =
instance.refs === EMPTY_OBJ ? (instance.refs = {}) : instance.refs

const canSetSetupRef = createCanSetSetupRefChecker(setupState)
const canSetSetupRef = __DEV__ ? createCanSetSetupRefChecker(setupState) : NO
// dynamic ref changed. unset old ref
if (oldRef != null && oldRef !== ref) {
if (isString(oldRef)) {
refs[oldRef] = null
if (__DEV__ && hasOwn(setupState, oldRef)) {
if (__DEV__ && canSetSetupRef(oldRef)) {
setupState[oldRef] = null
}
} else if (isRef(oldRef)) {
Expand Down
Loading