Skip to content

Example navigation hook captures an outdated callback and rebuilds animation values #1117

Description

@OskarEichler

The current example useNavigationPanel memoizes onPageSelected with empty dependencies, so replacing onPageSelectedCallback still invokes the old callback. A real React 19 harness reproduces this, and five updates allocate 18 Animated.Values instead of retaining three. Proposed fix: lazy initialization, complete stable handler dependencies and an optional no-op callback without a fresh default function. The public hook has a separately tracked allocation fix in #1107. This source audit is AI-assisted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions