Skip to content

use/useForwardPropsEmits ​

Overview ​

A fixed wrapper around reka-ui's useForwardPropsEmits that correctly handles both the array form and the object form of defineEmits. reka-ui's built-in useEmitAsProps reads vm.type.emits and calls forEach on it, which fails when defineEmits is called with the object validator form (e.g. { 'update:open': null }) because that produces an object, not an array. This module handles both forms.

Methods ​

Source ​

client/lib/use/useForwardPropsEmits.js:1