Skip to content
Advertisement

How do I map recordset to an array in React?

I am trying to return an array. I read a recordset from SQL and get data:

JavaScript

I want to return this as an array, I try (in a function with Promise<StartText>):

JavaScript

with StartText:

JavaScript

but this says:

JavaScript

So how do I return the recordset (actually ideally I would like to return a single value for start_type and a dictionary of field_name: start_text pairs but first things first).

Advertisement

Answer

I changed the promise to: Promise <Array<StartText>>.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement