Skip to content

Custom component for CopilotStep text prop #342

@bryanprimus

Description

@bryanprimus

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 react-native-copilot@3.3.3 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions