;(slots as any)[key] = normalizeSlot(key, value)
} else {
if (__DEV__) {
- // TODO show tip on using functions
- console.log('use function slots!')
+ warn(
+ `Non-function value encountered for slot "${key}". ` +
+ `Prefer function slots for better performance.`
+ )
}
value = normalizeSlotValue(value)
;(slots as any)[key] = () => value
} else if (children !== null) {
// non slot object children (direct value) passed to a component
if (__DEV__) {
- // TODO show tip on using functions
- console.log('use function slots!')
+ warn(
+ `Non-function value encountered for default slot. ` +
+ `Prefer function slots for better performance.`
+ )
}
const normalized = normalizeSlotValue(children)
slots = { default: () => normalized }