Reputation: 187
I'm trying to pull out the data from array images. In ImageValue i have two strings: symbol and imageType. Why i get this error about property 'value'.
Error
Property 'value' does not exist on type 'ImageValue'
Array with data
Component
this.props.images.filter((image) =>
image.value.symbol.toLowerCase().includes(this.state.searchSymbol.toLowerCase())
).map(image => (
table.push(
<div>{image.value.symbol + "." + image.value.imageType}</div>
)
));
ImageValue
class ImageValue {
symbol: string;
imageType: string;
}
Upvotes: 0
Views: 58
Reputation: 53934
I think that you have mistaken typing the ImageValue
:
type ImageValueType {
value: {
symbol: string;
imageType: string;
}
}
Upvotes: 2