use-dom

Implement Expo DOM components that run web code in native webviews.

Updated May 20, 2026
One-click install
npx skills add https://github.com/TechCorp25/kingdom --skill use-dom-techcorp25
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: use-dom
Source: https://github.com/TechCorp25/kingdom/tree/main/.claude/skills/use-expo/use-dom
Command: npx skills add https://github.com/TechCorp25/kingdom --skill use-dom-techcorp25

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? React Native apps cannot directly use web-only libraries like recharts or react-syntax-highlighter, forcing developers to rewrite existing React web code for native platforms. This Skill guides the creation of Expo DOM components that run web code verbatim in a webview on iOS and Android while rendering as-is on web. ## Core Features & Use Cases - DOM Component Authoring: Create components with the 'use dom' directive, the typed dom prop, and serializable props following Expo's rules. - Native-to-Web Bridge: Expose native actions like alerts and storage to the webview by passing async functions as props. - Web Library Integration: Use libraries such as recharts and react-syntax-highlighter inside native apps without modification. - Use Case: You have an existing React web dashboard built with recharts. Wrap it in a DOM component and embed it directly in your Expo app alongside native screens, passing route params from the native parent. ## Quick Start Create an Expo DOM component that renders my recharts line chart inside the native home screen.

Frequently Asked Questions about use-dom

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

FAQPage Schema
How do I create an Expo DOM component?▼

Create a new file with the 'use dom' directive at the top and a single default-exported React component. Type the dom prop as import("expo/dom").DOMProps, keep props serializable, and include any CSS imports inside the component file since it runs in an isolated context.

How to use web libraries like recharts in React Native?▼

Wrap the web library in an Expo DOM component with the 'use dom' directive. The component runs in a webview on iOS and Android and renders as-is on web, so libraries like recharts or react-syntax-highlighter work without modification.

Can DOM components use expo-router navigation hooks?▼

Link and useRouter work inside DOM components, but useLocalSearchParams, usePathname, useSegments, and similar hooks do not because they need synchronous native routing state. Read those values in the native parent and pass them down as props.

How do DOM components call native functions?▼

Pass async functions as props from the native parent to the DOM component. The webview can await these functions to trigger native alerts, save data to storage, or return results back to the web context.

When should I avoid using Expo DOM components?▼

Avoid DOM components when native performance is critical, for simple UI that React Native handles more efficiently, for deep native API integration, and in _layout route files which cannot be DOM components. Webviews add overhead and run in a separate JavaScript context.