I still don’t really understand how Stack
works. I thought it behaves like flex
for inline
and flex-direction: column
for block
, but it’s not working as I expected.
Here’s my code:
<Navigator>
<Screen name="ProductScanner" title="Product Scanner">
<ScrollView>
<Stack direction="block">
<Text variant="headingSmall">
Total items in cart: {totalItemsInCart}
</Text>
{product && (
<Section
title="Product"
action={{
title: "Scan another product",
onPress: () => {},
}}
>
{/* Product section */}
<Stack direction="inline" gap="200">
<Box inlineSize="120px" blockSize="120px">
<Image src={product?.featuredImage || ""} size="cover" />
</Box>
<Stack
direction="block"
gap="025"
paddingBlockStart="200"
paddingBlockEnd="200"
paddingInline="100"
>
<Text variant="headingSmall">{product.title}</Text>
</Stack>
</Stack>
</Section>
)}
</Stack>
</ScrollView>
</Screen>
</Navigator>
And here’s the actual UI:
Straight to the point — how can I make it take 100% width ?
Also, is there any way to check the actual generated HTML and CSS ?