This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo 路由 UI
用于 React Native 和 Web 应用的基于文件的路由库。
expo-router 是一个用于 React Native 和 Web 应用的路由库。它通过基于文件的路由系统实现导航管理,并提供原生导航组件。
了解 Expo Router 的基础知识、导航模式、核心概念等。
重要 在 SDK 56 及更高版本 中,Expo Router 不再支持在应用代码中从外部
@react-navigation/*包导入。请将这些导入重定向到匹配的expo-router入口点。运行 codemod 或按照 SDK 55 到 56 迁移指南 更新你的项目。
安装
🌐 Installation
要在你的项目中使用 Expo Router,你需要进行安装。请按照 Expo Router 安装指南中的说明操作:
🌐 To use Expo Router in your project, you need to install. Follow the instructions from the Expo Router's installation guide:
了解如何在项目中安装 Expo Router。
应用配置中的配置
🌐 Configuration in app config
如果你使用 default 模板创建新项目,expo-router 的 配置插件 已经在你的应用配置中设置好了。
🌐 If you are using the default template to create a new project, expo-router's config plugin is already configured in your app config.
Example app.json with config plugin
Configurable properties
用法
🌐 Usage
有关核心概念、符号模式、导航布局和常见导航模式的信息,请从“路由 101”部分开始:
🌐 For information core concepts, notation patterns, navigation layouts, and common navigation patterns, start with Router 101 section:
应用接口
🌐 APIs
应用接口
🌐 API
import { useRouter, Tabs, Navigator, Slot } from 'expo-router';
No API data file found, sorry!