ns-page-navigation-lifecycle

Installation
SKILL.md

Page navigation lifecycle and the backstack

For one forward navigation followed by back, a page fires exactly this sequence:

navigatingTo → loaded → navigatedTo   ...   navigatingFrom → unloaded → navigatedFrom

What is true at each step:

  • navigatingTo — earliest hook; args.context (the NavigationEntry.context) is available. Set bindingContext here.
  • loaded — the view tree exists and native views are attached, but Frame.topmost().currentPage is NOT this page yet. Don't read "the current page" here expecting yourself.
  • navigatedTo — navigation committed; currentPage is now this page. Start animations, timers, subscriptions here.
  • navigatingFrom / unloaded / navigatedFrom — note unloaded fires BEFORE navigatedFrom. Teardown that needs the native view must happen by unloaded; navigatedFrom is last and runs on an already-unloaded page.
  • After a back-pop the page is fully torn down: parent, frame and the native context are null, isLoaded is false. Never cache a popped Page for reuse.
  • page.navigationContext is cleared on back navigation — read what you need from it before leaving, or copy it onto your view model.
import { EventData, NavigatedData, Page } from '@nativescript/core';
Installs
19
GitHub Stars
1
First Seen
Aug 28, 2026
ns-page-navigation-lifecycle — nativescript/skills