Open manolo opened 3 years ago
The array you're trying to assign to grid.items
is of type (Client | undefined)[]
but the grid you define as GridElement<Client>
expects an array of type Client[]
. You should make sure that the array you're trying to assign to items
is of right type (in this case, an array that can't contain undefined
values).
If you want to accept undefined
values in the grid.items
array (not recommended), you can change the type of grid as GridElement<Client | undefined>
, but ideally Fusion should support annotating an endpoint function so that it would produce a client-side type with defined values only (await viewEndpoint.clients()
would return Client[] | undefined
instead of (Client | undefined)[] | undefined
)
Given this Entity
It's impossible assign the endpoint result to the
grid.items
in the following viewThe error in TS is