Custom component for `CopilotStep` text prop

未关闭
#342 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
react-native, typescript
领域
mobile

调研方向

首先检查 node_modules/react-native-copilot/dist/index.d.ts 中的 Step 和 Props 声明,并将其与提供的补丁进行比较。确认 CopilotStep 可以接受 React 组件作为其文本值,并且已发布的声明能够一致地表示这一点。

由索引模型根据 Issue 内容生成。

描述

Hi! 👋

Is it currently feasible to pass a custom component as the value for the text prop?

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-copilot/dist/index.d.ts b/node_modules/react-native-copilot/dist/index.d.ts
index 8b9d6e7..ea8e4d7 100644
--- a/node_modules/react-native-copilot/dist/index.d.ts
+++ b/node_modules/react-native-copilot/dist/index.d.ts
@@ -9,7 +9,7 @@ interface Step {
     visible: boolean;
     wrapperRef: React.RefObject<NativeMethods>;
     measure: () => Promise<LayoutRectangle>;
-    text: string;
+    text: string | React$1.ReactNode
 }
 interface ValueXY {
     x: number;
@@ -49,7 +49,7 @@ declare function walkthroughable<P = any>(WrappedComponent: React__default.Compo
 interface Props {
     name: string;
     order: number;
-    text: string;
+    text: Step["text"];
     children: React__default.ReactElement<any>;
     active?: boolean;
 }

This issue body was partially generated by patch-package.

主要语言
TypeScript
星标
2.4k
派生
425
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mohebifar/react-native-copilot 的其他 Issue

查看 mohebifar/react-native-copilot 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。