Type 'AssertsShape<{ dashboard: RequiredStringSchema<string | undefined, AnyObject>; link: RequiredStringSchema<string | undefined, AnyObject>; }>[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
Supporting Information
Please provide other information which led to this error, and any specific questions you have about it: I have a React component that exists only when this data is available and it's always an array, but could be undefined before as is DB fetched data. Now I'm trying to spread the array into a new array to add another item like this: [...prop, newData]
Error Text
Type 'AssertsShape<{ dashboard: RequiredStringSchema<string | undefined, AnyObject>; link: RequiredStringSchema<string | undefined, AnyObject>; }>[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
Supporting Information
Please provide other information which led to this error, and any specific questions you have about it: I have a React component that exists only when this data is available and it's always an array, but could be undefined before as is DB fetched data. Now I'm trying to spread the array into a new array to add another item like this: [...prop, newData]