One-click install
npx skills add https://github.com/soham2008xyz/trade-tycoon --skill use-dom-soham2008xyz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: use-dom
Source: https://github.com/soham2008xyz/trade-tycoon/tree/main/.agents/skills/use-dom
Command: npx skills add https://github.com/soham2008xyz/trade-tycoon --skill use-dom-soham2008xyz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

DOM components let you run React web code inside an Expo app without rewriting it for React Native, so you can reuse web-only libraries and complex web layouts while still targeting native platforms.

Core Features & Use Cases

  • Run web-only libraries in Expo: Use DOM rendering to integrate tools that depend on browser DOM APIs, like charting and syntax highlighting libraries.
  • Incremental migration from web to native: Move existing React web components into a native app progressively, without a full rewrite.
  • Preserve advanced HTML/CSS behaviors: Build complex layouts, embeds, iframes, and browser-based visuals that aren’t available (or are limited) in React Native.

Quick Start

Create a DOM component file that starts with the line "use dom" and type the required dom prop as import("expo/dom").DOMProps.

Frequently Asked Questions about use-dom

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

FAQPage Schema
How do I use web-only React libraries in Expo native apps?

You can run web-only React libraries in Expo native apps by using DOM components, which render standard web code inside a native WebView to enable direct code reuse without rewriting for React Native.

What is the best way to incrementally migrate a React web app to React Native?

Incremental migration from React web to native is achieved by moving existing web components into an Expo app progressively using DOM components, avoiding a full rewrite while targeting native platforms.

How does a DOM component handle complex HTML and CSS in React Native?

A DOM component handles complex HTML and CSS by rendering the web-oriented React UI inside a native WebView, preserving advanced browser-based layouts, embeds, and visual behaviors not natively available in React Native.

Do I need to rewrite my React components to use the use dom directive in Expo?

No, you do not need to rewrite your React components; you simply add the "use dom" directive to a file, export a single React component, and pass only serializable props to configure the webview behavior.

Can I pass any type of React props to a DOM component in Expo?

No, you cannot pass any type of props to a DOM component; you must pass only serializable props and type the required dom prop as import("expo/dom").DOMProps to ensure correct webview behavior.

When should I not use DOM components for web UI integration?

You should not use DOM components when standard React Native primitives suffice, as rendering web UI inside a webview introduces overhead and limits direct access to native platform APIs and navigation behaviors.