Create React Native Library

作者 callstackincubator61e6e7dfdf3aMIT1.6K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Scaffolds React Native libraries with create-react-native-library for standalone libraries or local native modules and views. Use when creating or working on React Native libraries or adding native functionality in an existing app.

AI 生成的概览

用于搭建 React Native 库,可创建独立库,也可在现有应用中添加本地原生模块和视图。

功能
指导代理使用 create-react-native-library 命令行工具搭建 React Native 库,涵盖纯 JS 库、原生模块和原生 UI 组件。它将工作分为两条流程:创建可发布的新库,以及通过自动链接向现有应用添加本地库。它提供参考文档和带类型、语言、示例应用等选项的命令行调用示例。
适用场景
适用于创建或处理 React Native 库、在现有应用中添加原生模块或视图,或封装原生 SDK 供 React Native 使用。它用于在实现之前选择合适的搭建流程。
运行要求
需要 Node.js 和 npx 来运行 create-react-native-library 命令行工具,并需要网络访问以获取该包。它不附带脚本,仅为说明和参考文档。

Create React Native Library

Overview

Use this skill to scaffold a standalone React Native library or a local library inside an existing app, then continue with the correct implementation docs.

Examples:

  • JS-only library that may use other React Native libraries
  • Native modules that expose native functionality to JavaScript
  • Native UI components that render native views in React Native

Choose one flow first:

  • Use scaffold-library.md [blocked] when creating a new library that may be published to npm
  • Use local-library.md [blocked] when exposing native functionality in a React Native app

When to Apply

Use this skill when:

  • Creating or working on a React Native library with create-react-native-library
  • Creating a native module or view in an existing app
  • Wrapping native SDKs and exposing them to React Native

Quick Reference

bash
# Inspect current options before scaffoldingnpx create-react-native-library@latest --help
# Scaffold a library with turbo modules and the Expo example appnpx create-react-native-library@latest awesome-library \  --no-interactive \  --yes \  --description "A brief description of the library" \  --type turbo-module \  --languages kotlin-objc \  --example expo
# Scaffold a local Turbo Module inside an existing appcd MyAppnpx create-react-native-library@latest awesome-library \  --local \  --no-interactive \  --yes \  --description "A brief description of the library" \  --type turbo-module \  --languages kotlin-objc

References

FileDescription
scaffold-library.md [blocked]Scaffold a new library and default to the Expo example
local-library.md [blocked]Add a local library to an existing app with autolinking

Problem -> Skill Mapping

ProblemStart With
Need a new library scaffoldscaffold-library [blocked]
Need to add a local native library to an applocal-library [blocked]

来源与署名

来源:callstackincubator/agent-skills位于skills/create-react-native-library提交61e6e7d

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架