When using TypeScript how do you loop through an object within a React (or SolidJS) components HTML? is there a correct syntax or does it require a work around?
export default function MyComponent(props: any) {
return (
<>
{Object.values(props.someObject).map(value => {
<div>{value.name}</div> {/* Error: Object is of type 'unknown'. */}
})}
</>
)
}
I'm following this SolidJS tutorial for context: https://youtu.be/WSvmEG7HPyE
Specifically id like to use the <For> loop component built into SolidJS which I believe is just a shorthand syntax of map.
<For each={props.someObject}>
{value =>
<div>{value.name}</div> {/* Error: Object is of type 'unknown'. */}
}
</For>