Pilates
    Preparing search index...

    Function useScrollIntoFocus

    • Notify the nearest enclosing <ScrollView> to scroll the referenced node into the visible viewport when isFocused becomes true.

      nodeRef must point to a Pilates <Box> element. The hook reads _layout from the Box's underlying render node after each commit and forwards the resulting bounds to the scroll context.

      When the Box's _layout.height is 0 (the common case for <Box> wrapping <Text> in Pilates — text height is attributed to the TextNode, not the parent Box), the node reference is forwarded alongside the zero bounds so <ScrollView> can locate the item by scanning its child list.

      Parameters

      • isFocused: boolean
      • nodeRef: RefObject<unknown>

      Returns void