Types for an object passed as props
I run a map where I loop out content from a CMS
Then I use this data in my component, it looks like this
So I use the data in "items" I get from my CMS. Items are descirbed by ContentProps. How can I tell TS this?
Currently getting an error on "allContent" in my map stating "Type 'string' is not assignable to type 'ContentProps'"
Do I have to manually pass each value instead of sending everything as an object? Seems a bit cumbersom
1 Reply
I solved this, solution was to make ContentProps an array (object? )