React Native 没有内置导航 — 标准解决方案是 React Navigation(一个流行库),用于在屏幕之间移动。它提供导航器(stack、tabs、drawer)并处理导航状态、历史记录和转换。
React Navigation — 标准库
Navigation isn't built into React Native → use REACT NAVIGATION (the de facto standard):
→ provides NAVIGATORS that structure how users move between screens:
STACK navigator → push/pop screens (like a stack — forward/back, the most common)
TAB navigator → bottom/top tabs (switch between sections)
DRAWER navigator → a side drawer menu
→ handles navigation state, history (back stack), transitions, headers
堆栈导航示例
= ();
() {
(
);
}
() {
;
}
