react-native-copilot icon indicating copy to clipboard operation
react-native-copilot copied to clipboard

Need copilot step for multiple element on custom component

Open tanzeel152 opened this issue 2 years ago • 3 comments

How to implement copilot for components for multiple UI?

tanzeel152 avatar Sep 27 '23 05:09 tanzeel152

I just found out you can do something like this:

import React from 'react';
import {View} from 'react-native';

const CustomCopilotView = (props: {children: JSX.Element; copilot?: any}) => {
  return <View {...props.copilot}>{props.children}</View>;
};

export default CustomCopilotView;

Just wrap your custom component into this CustomCopilotView inside of a step!

laurensk avatar Oct 04 '23 11:10 laurensk

@laurensk what to pass in {children: JSX.Element; copilot?: any} could you please help on function call

sagarhudge-eaton avatar Oct 06 '23 08:10 sagarhudge-eaton

Here is a usage example:

<CopilotStep
        order={1}
        name="step1"
        text="This is the text for the step.">
        <CustomCopilotView>
                // Your component goes here...
        </CustomCopilotView>
</CopilotStep>

laurensk avatar Oct 06 '23 10:10 laurensk