Ošetření pádu aplikace při selhání food.api
This commit is contained in:
parent
78b858120e
commit
0b2edeaac3
@ -154,13 +154,13 @@ function App() {
|
|||||||
<h3>{name}</h3>
|
<h3>{name}</h3>
|
||||||
<Table striped bordered hover>
|
<Table striped bordered hover>
|
||||||
<tbody>
|
<tbody>
|
||||||
{food.map((f: any, index: number) =>
|
{food?.length>0?food.map((f: any, index: number) =>
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>{f.amount}</td>
|
<td>{f.amount}</td>
|
||||||
<td>{f.name}</td>
|
<td>{f.name}</td>
|
||||||
<td>{f.price}</td>
|
<td>{f.price}</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
):<h1>Hmmmmm podivné.... nic se nevrátilo</h1>}
|
||||||
</tbody>
|
</tbody>
|
||||||
</Table>
|
</Table>
|
||||||
</Col>
|
</Col>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user