expo-dom

Implements Expo DOM Components that run React web libraries inside native webviews.

16|1|Updated May 5, 2026
One-click install
npx skills add https://github.com/AIBiz-Automatyzacje/workspace-template-mobile --skill expo-dom-aibiz-automatyzacje
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expo-dom
Source: https://github.com/AIBiz-Automatyzacje/workspace-template-mobile/tree/main/.claude/skills/expo-dom
Command: npx skills add https://github.com/AIBiz-Automatyzacje/workspace-template-mobile --skill expo-dom-aibiz-automatyzacje

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React Native apps cannot directly use web-only libraries like recharts, chart.js, or react-syntax-highlighter because they depend on DOM APIs. This Skill guides you through Expo DOM Components, which run web code verbatim in a webview on iOS and Android while rendering as-is on web, enabling incremental migration of web code to native apps. ## Core Features & Use Cases - Web Library Integration: Use any React web library (charts, syntax highlighters, rich text editors) inside a native Expo app without rewriting it. - Native-to-Web Bridge: Expose native actions (alerts, storage, database writes) to the webview by passing async functions as props, with serializable data crossing the bridge. - Router & Platform Handling: Use expo-router Link and navigation inside DOM components, pass route params as props, and detect the DOM environment with IS_DOM. - Use Case: You need an interactive recharts line chart in your Expo app. Create a component with the 'use dom' directive, import recharts, and render it from a native screen with a typed dom prop controlling size and scrolling. ## Quick Start Ask the assistant to create an Expo DOM component that renders a recharts line chart from a data prop and shows a native alert when a point is tapped.

Frequently Asked Questions about expo-dom

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use web libraries like recharts in a React Native Expo app?

Create a file with the 'use dom' directive at the top, export a single React component that imports the web library, and render it from a native screen. Expo runs it in a webview on iOS and Android and as-is on web.

What is the 'use dom' directive in Expo?

The 'use dom' directive marks a file as an Expo DOM Component. The file must contain a single default-exported React component, accept only serializable props, and receive a special dom prop typed as import("expo/dom").DOMProps for webview configuration.

Can DOM components call native functions like alerts or storage?

Yes. Pass async functions as props from the native parent component; the DOM component can await them to trigger native alerts, save data, or access device APIs. Arguments and return values must be serializable.

Why do useLocalSearchParams and usePathname not work inside DOM components?

These expo-router hooks need synchronous access to native routing state, which is unavailable inside the webview's isolated JavaScript context. Read the values in the native parent screen and pass them down as props instead.

When should I avoid using Expo DOM components?

Avoid them when native performance is critical, for simple UI that React Native handles more efficiently, when deep native API integration is needed, and in _layout route files, which cannot be DOM components.