mirror of
https://github.com/vercel-labs/json-render.git
synced 2026-09-14 13:41:32 +08:00
801708a128
* react native * fixes * pop/push * fixes * rename data -> state * remove . tsbuildinfo * fixes * fixes * user prompt * fixes * $id * combine catalog.ts * better actions * repeat * fix docs * fixes * fixes * fixes * better stream * catalog * fixes * fixes * fixes * dialog * sonner * accordion * catalog on homepage * fixes * more catalog * fixes * fixes * refactor * mv * 404 * fixes * nested * fixes * fixes * fixes * fixes * mobile playground * mdx * fix mdx * fixes * streamdown * fixes * use haiku * fixes * great * fixes * fix ... * fixes * fixes * fix build * fix lint * fix lint * fix lint * fix tests
28 lines
930 B
TypeScript
28 lines
930 B
TypeScript
import React from "react";
|
|
import Ionicons from "@expo/vector-icons/Ionicons";
|
|
import { defineRegistry, type Components } from "@json-render/react-native";
|
|
import { catalog } from "./catalog";
|
|
|
|
// =============================================================================
|
|
// Registry
|
|
// =============================================================================
|
|
|
|
/**
|
|
* Custom component registry using defineRegistry.
|
|
*
|
|
* Only custom components need to be defined here — standard React Native
|
|
* components (Container, Row, Column, Button, etc.) are included automatically
|
|
* by the Renderer via `includeStandard`.
|
|
*/
|
|
export const { registry } = defineRegistry(catalog, {
|
|
components: {
|
|
Icon: ({ props }) => (
|
|
<Ionicons
|
|
name={props.name as keyof typeof Ionicons.glyphMap}
|
|
size={props.size ?? 24}
|
|
color={props.color ?? "#111827"}
|
|
/>
|
|
),
|
|
} as Components<typeof catalog>,
|
|
});
|