-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Description
Describe the bug
Typescript shows an error when using control.value
: Property 'value' does not exist on type
But the control
is returned as a ComputedRef
object actually.
Expected behavior
control
returns a ComputedRef object.
jsonforms/packages/vue/vue/src/jsonFormsCompositions.ts
Lines 169 to 172 in d2bf053
const control = computed(() => ({ | |
...stateMap({ jsonforms }, props), | |
id: id.value | |
})); |
Perhaps the line 150, 155, and 190 should replace with ComputedRef<R>
jsonforms/packages/vue/vue/src/jsonFormsCompositions.ts
Lines 147 to 155 in d2bf053
export function useControl<R, D, P extends {}>( | |
props: P, | |
stateMap: (state: JsonFormsState, props: P) => R | |
): { control: Required<R> }; | |
export function useControl<R, D, P extends {}>( | |
props: P, | |
stateMap: (state: JsonFormsState, props: P) => R, | |
dispatchMap: (dispatch: Dispatch<CoreActions>) => D | |
): { control: Required<R> } & D; |
Steps to reproduce the issue
- Call functions that call
useControl
inside, e.g.useJsonFormsControl
- Get value by
control.value
- See type error
Screenshots
No response
In which browser are you experiencing the issue?
Brave 1.38.115
Framework
Vue 2
RendererSet
Other (please specify in the Additional context field)
Additional context
No response