David Ewins
Error library

Rows wrapped in <Link asChild> collapse to a tiny height

React NativeLikely fix

expo-router Link asChild, Pressable style function

There is no error message for this one, only the symptom in the title.

Cause

Link's Slot merges the child's style with an object spread. The Pressable used a style function (style={({ pressed }) => ...}), and spreading a function gives {}, so the height was dropped. Only rows not wrapped in Link kept their height.

Fix

Use a plain style object on the child of <Link asChild>, or drop Link and navigate with router.push() in onPress.

More React Native errors

Search all errors