Calling the function requires a slightly different implementation.
dylannirvana opened this issue · 1 comments
dylannirvana commented
The pattern I am using is different. I am holding the array object in state. Close, but I am not sure how exactly to do this.
return this.state.data.length > 1
? this.state.data.map((item) => (
<Card key={item.sku} >
<CardImg src={item.image} />
<CardTitle> {item.sku} </CardTitle>
<CardBody> {item.name} </CardBody>
</Card>
))
: null
}
And I am using it by calling the function (not a parameter).
<Row className="grid" > {this.renderData()} </Row>
</Container>```
afram commented
I'm not sure what your question is sorry. Can you provide more context please?