[Vuejs]-Vue composition api array in reactive object typing error

0πŸ‘

βœ…

I managed to solve the issue by casting state to uknown then to TableState like so :

  const state = (reactive<TableState<T>>({
    items: [] as T[],
  }) as unknown) as TableState<T>

I don’t know if it is the right solution but my error went away and I have access to type inference and autocompletion in my components.

Leave a comment