[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6J336KNHCJ0G0MDPKG6T1M4":3,"skill-same:01M6J336KNHCJ0G0MDPKG6T1M4":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":36,"commitSha":37,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M6J336KNHCJ0G0MDPKG6T1M4","use-dom",null,"Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally.","logos-42\u002Fcode-skills-tools-","logos-42","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F161792418?v=4","01M6HVX4J2Y2278DX75K70YXEC","yuanjie liu","01M6HVX4P66XN0D2Q9A22Q5YJ5",0,"MIT","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fuse-dom\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29],"use dom","use","dom","web","components","run","code","migrate","expo","as","native","2026-11-10 10:12:30",false,"---\nname: use-dom\ndescription: Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally.\nversion: 1.0.0\nlicense: MIT\n---\n\n## What are DOM Components?\n\nDOM 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.\n\n## When to Use DOM Components\n\nUse DOM components when you need:\n\n- **Web-only libraries** — Charts (recharts, chart.js), syntax highlighters, rich text editors, or any library that depends on DOM APIs\n- **Migrating web code** — Bring existing React web components to native without rewriting\n- **Complex HTML\u002FCSS layouts** — When CSS features aren't available in React Native\n- **iframes or embeds** — Embedding external content that requires a browser context\n- **Canvas or WebGL** — Web graphics APIs not available natively\n\n## When NOT to Use DOM Components\n\nAvoid DOM components when:\n\n- **Native performance is critical** — Webviews add overhead\n- **Simple UI** — React Native components are more efficient for basic layouts\n- **Deep native integration** — Use local modules instead for native APIs\n- **Layout routes** — `_layout` files cannot be DOM components\n\n## Basic DOM Component\n\nCreate a new file with the `'use dom';` directive at the top:\n\n```tsx\n\u002F\u002F components\u002FWebChart.tsx\n\"use dom\";\n\nexport default function WebChart({\n  data,\n}: {\n  data: number[];\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return (\n    \u003Cdiv style={{ padding: 20 }}>\n      \u003Ch2>Chart Data\u003C\u002Fh2>\n      \u003Cul>\n        {data.map((value, i) => (\n          \u003Cli key={i}>{value}\u003C\u002Fli>\n        ))}\n      \u003C\u002Ful>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Rules for DOM Components\n\n1. **Must have `'use dom';` directive** at the top of the file\n2. **Single default export** — One React component per file\n3. **Own file** — Cannot be defined inline or combined with native components\n4. **Serializable props only** — Strings, numbers, booleans, arrays, plain objects\n5. **Include CSS in the component file** — DOM components run in isolated context\n\n## The `dom` Prop\n\nEvery DOM component receives a special `dom` prop for webview configuration. Always type it in your props:\n\n```tsx\n\"use dom\";\n\ninterface Props {\n  content: string;\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function MyComponent({ content }: Props) {\n  return \u003Cdiv>{content}\u003C\u002Fdiv>;\n}\n```\n\n### Common `dom` Prop Options\n\n```tsx\n\u002F\u002F Disable body scrolling\n\u003CDOMComponent dom={{ scrollEnabled: false }} \u002F>\n\n\u002F\u002F Flow under the notch (disable safe area insets)\n\u003CDOMComponent dom={{ contentInsetAdjustmentBehavior: \"never\" }} \u002F>\n\n\u002F\u002F Control size manually\n\u003CDOMComponent dom={{ style: { width: 300, height: 400 } }} \u002F>\n\n\u002F\u002F Combine options\n\u003CDOMComponent\n  dom={{\n    scrollEnabled: false,\n    contentInsetAdjustmentBehavior: \"never\",\n    style: { width: '100%', height: 500 }\n  }}\n\u002F>\n```\n\n## Exposing Native Actions to the Webview\n\nPass async functions as props to expose native functionality to the DOM component:\n\n```tsx\n\u002F\u002F app\u002Findex.tsx (native)\nimport { Alert } from \"react-native\";\nimport DOMComponent from \"@\u002Fcomponents\u002Fdom-component\";\n\nexport default function Screen() {\n  return (\n    \u003CDOMComponent\n      showAlert={async (message: string) => {\n        Alert.alert(\"From Web\", message);\n      }}\n      saveData={async (data: { name: string; value: number }) => {\n        \u002F\u002F Save to native storage, database, etc.\n        console.log(\"Saving:\", data);\n        return { success: true };\n      }}\n    \u002F>\n  );\n}\n```\n\n```tsx\n\u002F\u002F components\u002Fdom-component.tsx\n\"use dom\";\n\ninterface Props {\n  showAlert: (message: string) => Promise\u003Cvoid>;\n  saveData: (data: {\n    name: string;\n    value: number;\n  }) => Promise\u003C{ success: boolean }>;\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function DOMComponent({ showAlert, saveData }: Props) {\n  const handleClick = async () => {\n    await showAlert(\"Hello from the webview!\");\n    const result = await saveData({ name: \"test\", value: 42 });\n    console.log(\"Save result:\", result);\n  };\n\n  return \u003Cbutton onClick={handleClick}>Trigger Native Action\u003C\u002Fbutton>;\n}\n```\n\n## Using Web Libraries\n\nDOM components can use any web library:\n\n```tsx\n\u002F\u002F components\u002Fsyntax-highlight.tsx\n\"use dom\";\n\nimport SyntaxHighlighter from \"react-syntax-highlighter\";\nimport { docco } from \"react-syntax-highlighter\u002Fdist\u002Fesm\u002Fstyles\u002Fhljs\";\n\ninterface Props {\n  code: string;\n  language: string;\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function SyntaxHighlight({ code, language }: Props) {\n  return (\n    \u003CSyntaxHighlighter language={language} style={docco}>\n      {code}\n    \u003C\u002FSyntaxHighlighter>\n  );\n}\n```\n\n```tsx\n\u002F\u002F components\u002Fchart.tsx\n\"use dom\";\n\nimport {\n  LineChart,\n  Line,\n  XAxis,\n  YAxis,\n  CartesianGrid,\n  Tooltip,\n} from \"recharts\";\n\ninterface Props {\n  data: Array\u003C{ name: string; value: number }>;\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function Chart({ data }: Props) {\n  return (\n    \u003CLineChart width={400} height={300} data={data}>\n      \u003CCartesianGrid strokeDasharray=\"3 3\" \u002F>\n      \u003CXAxis dataKey=\"name\" \u002F>\n      \u003CYAxis \u002F>\n      \u003CTooltip \u002F>\n      \u003CLine type=\"monotone\" dataKey=\"value\" stroke=\"#8884d8\" \u002F>\n    \u003C\u002FLineChart>\n  );\n}\n```\n\n## CSS in DOM Components\n\nCSS imports must be in the DOM component file since they run in isolated context:\n\n```tsx\n\u002F\u002F components\u002Fstyled-component.tsx\n\"use dom\";\n\nimport \"@\u002Fstyles.css\"; \u002F\u002F CSS file in same directory\n\nexport default function StyledComponent({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return (\n    \u003Cdiv className=\"container\">\n      \u003Ch1 className=\"title\">Styled Content\u003C\u002Fh1>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\nOr use inline styles \u002F CSS-in-JS:\n\n```tsx\n\"use dom\";\n\nconst styles = {\n  container: {\n    padding: 20,\n    backgroundColor: \"#f0f0f0\",\n  },\n  title: {\n    fontSize: 24,\n    color: \"#333\",\n  },\n};\n\nexport default function StyledComponent({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return (\n    \u003Cdiv style={styles.container}>\n      \u003Ch1 style={styles.title}>Styled Content\u003C\u002Fh1>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Expo Router in DOM Components\n\nThe expo-router `\u003CLink \u002F>` component and router API work inside DOM components:\n\n```tsx\n\"use dom\";\n\nimport { Link, useRouter } from \"expo-router\";\n\nexport default function Navigation({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  const router = useRouter();\n\n  return (\n    \u003Cnav>\n      \u003CLink href=\"\u002Fabout\">About\u003C\u002FLink>\n      \u003Cbutton onClick={() => router.push(\"\u002Fsettings\")}>Settings\u003C\u002Fbutton>\n    \u003C\u002Fnav>\n  );\n}\n```\n\n### Router APIs That Require Props\n\nThese hooks don't work directly in DOM components because they need synchronous access to native routing state:\n\n- `useLocalSearchParams()`\n- `useGlobalSearchParams()`\n- `usePathname()`\n- `useSegments()`\n- `useRootNavigation()`\n- `useRootNavigationState()`\n\n**Solution:** Read these values in the native parent and pass as props:\n\n```tsx\n\u002F\u002F app\u002F[id].tsx (native)\nimport { useLocalSearchParams, usePathname } from \"expo-router\";\nimport DOMComponent from \"@\u002Fcomponents\u002Fdom-component\";\n\nexport default function Screen() {\n  const { id } = useLocalSearchParams();\n  const pathname = usePathname();\n\n  return \u003CDOMComponent id={id as string} pathname={pathname} \u002F>;\n}\n```\n\n```tsx\n\u002F\u002F components\u002Fdom-component.tsx\n\"use dom\";\n\ninterface Props {\n  id: string;\n  pathname: string;\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function DOMComponent({ id, pathname }: Props) {\n  return (\n    \u003Cdiv>\n      \u003Cp>Current ID: {id}\u003C\u002Fp>\n      \u003Cp>Current Path: {pathname}\u003C\u002Fp>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Detecting DOM Environment\n\nCheck if code is running in a DOM component:\n\n```tsx\n\"use dom\";\n\nimport { IS_DOM } from \"expo\u002Fdom\";\n\nexport default function Component({\n  dom,\n}: {\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return \u003Cdiv>{IS_DOM ? \"Running in DOM component\" : \"Running natively\"}\u003C\u002Fdiv>;\n}\n```\n\n## Assets\n\nPrefer requiring assets instead of using the public directory:\n\n```tsx\n\"use dom\";\n\n\u002F\u002F Good - bundled with the component\nconst logo = require(\"..\u002Fassets\u002Flogo.png\");\n\nexport default function Component({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return \u003Cimg src={logo} alt=\"Logo\" \u002F>;\n}\n```\n\n## Usage from Native Components\n\nImport and use DOM components like regular components:\n\n```tsx\n\u002F\u002F app\u002Findex.tsx\nimport { View, Text } from \"react-native\";\nimport WebChart from \"@\u002Fcomponents\u002Fweb-chart\";\nimport CodeBlock from \"@\u002Fcomponents\u002Fcode-block\";\n\nexport default function HomeScreen() {\n  return (\n    \u003CView style={{ flex: 1 }}>\n      \u003CText>Native content above\u003C\u002FText>\n\n      \u003CWebChart data={[10, 20, 30, 40, 50]} dom={{ style: { height: 300 } }} \u002F>\n\n      \u003CCodeBlock\n        code=\"const x = 1;\"\n        language=\"javascript\"\n        dom={{ scrollEnabled: true }}\n      \u002F>\n\n      \u003CText>Native content below\u003C\u002FText>\n    \u003C\u002FView>\n  );\n}\n```\n\n## Platform Behavior\n\n| Platform | Behavior                            |\n| -------- | ----------------------------------- |\n| iOS      | Rendered in WKWebView               |\n| Android  | Rendered in WebView                 |\n| Web      | Rendered as-is (no webview wrapper) |\n\nOn web, the `dom` prop is ignored since no webview is needed.\n\n## Tips\n\n- DOM components hot reload during development\n- Keep DOM components focused — don't put entire screens in webviews\n- Use native components for navigation chrome, DOM components for specialized content\n- Test on all platforms — web rendering may differ slightly from native webviews\n- Large DOM components may impact performance — profile if needed\n- The webview has its own JavaScript context — cannot directly share state with native\n","## What are DOM Components?\n\nDOM 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.\n\n## When to Use DOM Components\n\nUse DOM components when you need:\n\n- **Web-only libraries** — Charts (recharts, chart.js), syntax highlighters, rich text editors, or any library that depends on DOM APIs\n- **Migrating web code** — Bring existing React web components to native without rewriting\n- **Complex HTML\u002FCSS layouts** — When CSS features aren't available in React Native\n- **iframes or embeds** — Embedding external content that requires a browser context\n- **Canvas or WebGL** — Web graphics APIs not available natively\n\n## When NOT to Use DOM Components\n\nAvoid DOM components when:\n\n- **Native performance is critical** — Webviews add overhead\n- **Simple UI** — React Native components are more efficient for basic layouts\n- **Deep native integration** — Use local modules instead for native APIs\n- **Layout routes** — `_layout` files cannot be DOM components\n\n## Basic DOM Component\n\nCreate a new file with the `'use dom';` directive at the top:\n\n```tsx\n\u002F\u002F components\u002FWebChart.tsx\n\"use dom\";\n\nexport default function WebChart({\n  data,\n}: {\n  data: number[];\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return (\n    \u003Cdiv style={{ padding: 20 }}>\n      \u003Ch2>Chart Data\u003C\u002Fh2>\n      \u003Cul>\n        {data.map((value, i) => (\n          \u003Cli key={i}>{value}\u003C\u002Fli>\n        ))}\n      \u003C\u002Ful>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Rules for DOM Components\n\n1. **Must have `'use dom';` directive** at the top of the file\n2. **Single default export** — One React component per file\n3. **Own file** — Cannot be defined inline or combined with native components\n4. **Serializable props only** — Strings, numbers, booleans, arrays, plain objects\n5. **Include CSS in the component file** — DOM components run in isolated context\n\n## The `dom` Prop\n\nEvery DOM component receives a special `dom` prop for webview configuration. Always type it in your props:\n\n```tsx\n\"use dom\";\n\ninterface Props {\n  content: string;\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function MyComponent({ content }: Props) {\n  return \u003Cdiv>{content}\u003C\u002Fdiv>;\n}\n```\n\n### Common `dom` Prop Options\n\n```tsx\n\u002F\u002F Disable body scrolling\n\u003CDOMComponent dom={{ scrollEnabled: false }} \u002F>\n\n\u002F\u002F Flow under the notch (disable safe area insets)\n\u003CDOMComponent dom={{ contentInsetAdjustmentBehavior: \"never\" }} \u002F>\n\n\u002F\u002F Control size manually\n\u003CDOMComponent dom={{ style: { width: 300, height: 400 } }} \u002F>\n\n\u002F\u002F Combine options\n\u003CDOMComponent\n  dom={{\n    scrollEnabled: false,\n    contentInsetAdjustmentBehavior: \"never\",\n    style: { width: '100%', height: 500 }\n  }}\n\u002F>\n```\n\n## Exposing Native Actions to the Webview\n\nPass async functions as props to expose native functionality to the DOM component:\n\n```tsx\n\u002F\u002F app\u002Findex.tsx (native)\nimport { Alert } from \"react-native\";\nimport DOMComponent from \"@\u002Fcomponents\u002Fdom-component\";\n\nexport default function Screen() {\n  return (\n    \u003CDOMComponent\n      showAlert={async (message: string) => {\n        Alert.alert(\"From Web\", message);\n      }}\n      saveData={async (data: { name: string; value: number }) => {\n        \u002F\u002F Save to native storage, database, etc.\n        console.log(\"Saving:\", data);\n        return { success: true };\n      }}\n    \u002F>\n  );\n}\n```\n\n```tsx\n\u002F\u002F components\u002Fdom-component.tsx\n\"use dom\";\n\ninterface Props {\n  showAlert: (message: string) => Promise\u003Cvoid>;\n  saveData: (data: {\n    name: string;\n    value: number;\n  }) => Promise\u003C{ success: boolean }>;\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function DOMComponent({ showAlert, saveData }: Props) {\n  const handleClick = async () => {\n    await showAlert(\"Hello from the webview!\");\n    const result = await saveData({ name: \"test\", value: 42 });\n    console.log(\"Save result:\", result);\n  };\n\n  return \u003Cbutton onClick={handleClick}>Trigger Native Action\u003C\u002Fbutton>;\n}\n```\n\n## Using Web Libraries\n\nDOM components can use any web library:\n\n```tsx\n\u002F\u002F components\u002Fsyntax-highlight.tsx\n\"use dom\";\n\nimport SyntaxHighlighter from \"react-syntax-highlighter\";\nimport { docco } from \"react-syntax-highlighter\u002Fdist\u002Fesm\u002Fstyles\u002Fhljs\";\n\ninterface Props {\n  code: string;\n  language: string;\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function SyntaxHighlight({ code, language }: Props) {\n  return (\n    \u003CSyntaxHighlighter language={language} style={docco}>\n      {code}\n    \u003C\u002FSyntaxHighlighter>\n  );\n}\n```\n\n```tsx\n\u002F\u002F components\u002Fchart.tsx\n\"use dom\";\n\nimport {\n  LineChart,\n  Line,\n  XAxis,\n  YAxis,\n  CartesianGrid,\n  Tooltip,\n} from \"recharts\";\n\ninterface Props {\n  data: Array\u003C{ name: string; value: number }>;\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function Chart({ data }: Props) {\n  return (\n    \u003CLineChart width={400} height={300} data={data}>\n      \u003CCartesianGrid strokeDasharray=\"3 3\" \u002F>\n      \u003CXAxis dataKey=\"name\" \u002F>\n      \u003CYAxis \u002F>\n      \u003CTooltip \u002F>\n      \u003CLine type=\"monotone\" dataKey=\"value\" stroke=\"#8884d8\" \u002F>\n    \u003C\u002FLineChart>\n  );\n}\n```\n\n## CSS in DOM Components\n\nCSS imports must be in the DOM component file since they run in isolated context:\n\n```tsx\n\u002F\u002F components\u002Fstyled-component.tsx\n\"use dom\";\n\nimport \"@\u002Fstyles.css\"; \u002F\u002F CSS file in same directory\n\nexport default function StyledComponent({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return (\n    \u003Cdiv className=\"container\">\n      \u003Ch1 className=\"title\">Styled Content\u003C\u002Fh1>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\nOr use inline styles \u002F CSS-in-JS:\n\n```tsx\n\"use dom\";\n\nconst styles = {\n  container: {\n    padding: 20,\n    backgroundColor: \"#f0f0f0\",\n  },\n  title: {\n    fontSize: 24,\n    color: \"#333\",\n  },\n};\n\nexport default function StyledComponent({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return (\n    \u003Cdiv style={styles.container}>\n      \u003Ch1 style={styles.title}>Styled Content\u003C\u002Fh1>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Expo Router in DOM Components\n\nThe expo-router `\u003CLink \u002F>` component and router API work inside DOM components:\n\n```tsx\n\"use dom\";\n\nimport { Link, useRouter } from \"expo-router\";\n\nexport default function Navigation({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  const router = useRouter();\n\n  return (\n    \u003Cnav>\n      \u003CLink href=\"\u002Fabout\">About\u003C\u002FLink>\n      \u003Cbutton onClick={() => router.push(\"\u002Fsettings\")}>Settings\u003C\u002Fbutton>\n    \u003C\u002Fnav>\n  );\n}\n```\n\n### Router APIs That Require Props\n\nThese hooks don't work directly in DOM components because they need synchronous access to native routing state:\n\n- `useLocalSearchParams()`\n- `useGlobalSearchParams()`\n- `usePathname()`\n- `useSegments()`\n- `useRootNavigation()`\n- `useRootNavigationState()`\n\n**Solution:** Read these values in the native parent and pass as props:\n\n```tsx\n\u002F\u002F app\u002F[id].tsx (native)\nimport { useLocalSearchParams, usePathname } from \"expo-router\";\nimport DOMComponent from \"@\u002Fcomponents\u002Fdom-component\";\n\nexport default function Screen() {\n  const { id } = useLocalSearchParams();\n  const pathname = usePathname();\n\n  return \u003CDOMComponent id={id as string} pathname={pathname} \u002F>;\n}\n```\n\n```tsx\n\u002F\u002F components\u002Fdom-component.tsx\n\"use dom\";\n\ninterface Props {\n  id: string;\n  pathname: string;\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}\n\nexport default function DOMComponent({ id, pathname }: Props) {\n  return (\n    \u003Cdiv>\n      \u003Cp>Current ID: {id}\u003C\u002Fp>\n      \u003Cp>Current Path: {pathname}\u003C\u002Fp>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Detecting DOM Environment\n\nCheck if code is running in a DOM component:\n\n```tsx\n\"use dom\";\n\nimport { IS_DOM } from \"expo\u002Fdom\";\n\nexport default function Component({\n  dom,\n}: {\n  dom?: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return \u003Cdiv>{IS_DOM ? \"Running in DOM component\" : \"Running natively\"}\u003C\u002Fdiv>;\n}\n```\n\n## Assets\n\nPrefer requiring assets instead of using the public directory:\n\n```tsx\n\"use dom\";\n\n\u002F\u002F Good - bundled with the component\nconst logo = require(\"..\u002Fassets\u002Flogo.png\");\n\nexport default function Component({\n  dom,\n}: {\n  dom: import(\"expo\u002Fdom\").DOMProps;\n}) {\n  return \u003Cimg src={logo} alt=\"Logo\" \u002F>;\n}\n```\n\n## Usage from Native Components\n\nImport and use DOM components like regular components:\n\n```tsx\n\u002F\u002F app\u002Findex.tsx\nimport { View, Text } from \"react-native\";\nimport WebChart from \"@\u002Fcomponents\u002Fweb-chart\";\nimport CodeBlock from \"@\u002Fcomponents\u002Fcode-block\";\n\nexport default function HomeScreen() {\n  return (\n    \u003CView style={{ flex: 1 }}>\n      \u003CText>Native content above\u003C\u002FText>\n\n      \u003CWebChart data={[10, 20, 30, 40, 50]} dom={{ style: { height: 300 } }} \u002F>\n\n      \u003CCodeBlock\n        code=\"const x = 1;\"\n        language=\"javascript\"\n        dom={{ scrollEnabled: true }}\n      \u002F>\n\n      \u003CText>Native content below\u003C\u002FText>\n    \u003C\u002FView>\n  );\n}\n```\n\n## Platform Behavior\n\n| Platform | Behavior                            |\n| -------- | ----------------------------------- |\n| iOS      | Rendered in WKWebView               |\n| Android  | Rendered in WebView                 |\n| Web      | Rendered as-is (no webview wrapper) |\n\nOn web, the `dom` prop is ignored since no webview is needed.\n\n## Tips\n\n- DOM components hot reload during development\n- Keep DOM components focused — don't put entire screens in webviews\n- Use native components for navigation chrome, DOM components for specialized content\n- Test on all platforms — web rendering may differ slightly from native webviews\n- Large DOM components may impact performance — profile if needed\n- The webview has its own JavaScript context — cannot directly share state with native\n",{"name":5,"license":15,"version":35,"description":7},"1.0.0","main","4b15927a865ee5f789c01be4cbadccf4506907cc","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-","https:\u002F\u002Fgithub.com\u002Flogos-42","https:\u002F\u002Fliuyuanjie.xyz","Innovator;\r\nCreating Meaning for Oneself","2026-03-24 15:15:59",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add logos-42\u002Fcode-skills-tools- --skill use-dom",{"tool":49,"command":50},"bunx","bunx skills add logos-42\u002Fcode-skills-tools- --skill use-dom",{"tool":52,"command":53},"pnpm","pnpm dlx skills add logos-42\u002Fcode-skills-tools- --skill use-dom","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fuse-dom\u002FSKILL.md",true,[],[58,87,107,128,139,164],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":69,"publishedAt":30},"01M6J355Q8VVYY358XD4CX15AV","vercel-react-native-skills","React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fvercel-react-native-skills\u002FSKILL.md",[64],{"categoryNo":65,"categoryName":66,"taxonomyType":67,"taxonomyTypeDesc":68},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",[70,71,72,73,29,74,75,76,77,78,20,79,80,81,82,23,83,84,85,86],"react native","vercel react native skills","react","vercel","react native skills","react native components","with","apps","implementing","modules","mobile","best practices","tasks","platform","performance","for","triggers",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":94,"publishedAt":30},"01M6J34WZHMFA8CAXH0EKVR180","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fvercel-react-best-practices\u002FSKILL.md",[93],{"categoryNo":65,"categoryName":66,"taxonomyType":67,"taxonomyTypeDesc":68},[81,73,95,96,72,97,25,82,98,23,84,99,100,101,86,102,103,104,105,106],"react best practices","vercel react best practices","react components","guidelines","writing","data fetching","Optimization","pages","next","performance optimization","refactoring","Next.js",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":114,"publishedAt":30},"01M6J34E6QQER3EED22NXHEFMK","vercel-composition-patterns","React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fvercel-composition-patterns\u002FSKILL.md",[113],{"categoryNo":65,"categoryName":66,"taxonomyType":67,"taxonomyTypeDesc":68},[115,116,73,117,118,119,120,121,122,86,123,20,124,125,126,127,82,76,72,23],"Composition","vercel composition patterns","patterns","composition patterns","react composition patterns","architecture","render","react 19","reusable","react composition","api","component architecture","libraries",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":134,"publishedAt":30},"01M6J32XBWQNY2SKF7QH6KMGH5","upgrading-expo","Guidelines for upgrading Expo SDK versions and fixing dependency issues","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fupgrading-expo\u002FSKILL.md",[],[135,27,85,136,137,98,138],"upgrading expo","dependency","issues","sdk",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":143,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":155,"publishedAt":30},"01M6J2Z3X53806J7AGNEGWKN35","terraform-skill","Terraform infrastructure as code best practices","Apache-2.0","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fterraform-skill\u002FSKILL.md",[146,149,152],{"categoryNo":147,"categoryName":148,"taxonomyType":67,"taxonomyTypeDesc":68},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":150,"categoryName":151,"taxonomyType":67,"taxonomyTypeDesc":68},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":153,"categoryName":154,"taxonomyType":67,"taxonomyTypeDesc":68},"01JBSEEDCAT000000000000023","Skill与智能体开发",[156,157,158,81,25,159,160,161,162,28,163],"terraform","terraform skill","infrastructure as code","infrastructure","github","safe","https","terraform infrastructure",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":173,"publishedAt":30},"01M6J2VXY7YV7YZZH77MT79DJB","supabase-postgres-best-practices","Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.","https:\u002F\u002Fgithub.com\u002Flogos-42\u002Fcode-skills-tools-\u002Fblob\u002Fmain\u002Fsupabase-postgres-best-practices\u002FSKILL.md",[170],{"categoryNo":171,"categoryName":172,"taxonomyType":67,"taxonomyTypeDesc":68},"01JBSEEDCAT000000000000010","后端与接口",[81,174,175,176,177,99,178,85,179,180,181,182,183,184,20,185,186,101,187,84],"supabase postgres best practices","postgres","supabase","postgres best practices","impact","categories","advanced","postgres performance","critical","query","schema","Rules","correct","database"]