Answer the question
In order to leave comments, you need to log in
[[+content_image]]
Is the array of strings properly typed?
Typescript does not swear, but when passing it through props, it swears that everything needs to be typed as string | string[]:
const projectInfo: (string | string[])[][] = [['Registration form', 'Page with registration form of four fields, which displays an error notification if it is incorrectly filled.', ['Javascript', 'CSS']], ['Giphy', 'Page for search and watch gif files, from Giphy API. Multiple language and may copy gif.', ['React', 'Redax', 'Axios', 'CSS']], ['Landing Glopt', 'A page with several section, addaptation for any device.', ['Javascript', 'SASS', 'GULP']], ['Project Euler', 'Answers and solutions to problems of the famous Euler project.', ['Javascript']]
];
Answer the question
In order to leave comments, you need to log in
It's better to make a more precise type: [string, string, string[]][]
https://www.typescriptlang.org/play?#code/MYewdgzg...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question