expo-dom
使用 Expo DOM 组件在原生端的 webview 中运行 Web 代码,并在 Web 端按原样运行。逐步将 Web 代码迁移到原生端。若要对整个 Web 应用进行端到端迁移,请使用 expo-web-to-native 技能。
机器翻译查看英文原文
Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally. For the end-to-end migration of a whole web app, use the expo-web-to-native skill.
适用对象:移动应用开发。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- What are DOM Components?
- When to Use DOM Components
- When NOT to Use DOM Components
- Basic DOM Component
- Rules for DOM Components
- The dom Prop
- Common dom Prop Options
- Exposing Native Actions to the Webview
DOM components allow web code to run verbatim in a webview on native platforms while rendering as-is on web. This enables using web-only libraries like recharts, react-syntax-highlighter, or any React web library in your Expo app without modification. Use DOM components when you need: Web-only libraries — Charts (recharts, chart.js), syntax highlighters, rich text editors, or any library that depends on DOM APIs Migrating web code — Bring existing React web components to native without rewriting Complex HTML/CSS layouts — When CSS features aren't available in React Native iframes or embeds — Embedding external content that requires a browser context Canvas or WebGL — Web graphics APIs not available natively Avoid DOM components when: Native performance is critical — Webviews add overhead Simple UI — React Native components are more efficient for basic layouts Deep native integration — Use local modules instead for native APIs Layout routes — layout files cannot be DOM components Create a new file with the 'use dom'; directive at the top: 1. Must have 'use dom'; directive at the top of the file 2. Single default export — One React component per file 3. Own file — Cannot be defined i
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- expo/skills
- 源文件
- plugins/expo/skills/expo-dom/SKILL.md
- 固定版本
- a9e5bd3fa00b4e61f632e43f85da73aee1942582
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:Expo Skills · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T14:01:42.061Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。