react-native-copilot
react-native-copilot copied to clipboard
Need copilot step for multiple element on custom component
How to implement copilot for components for multiple UI?
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 what to pass in {children: JSX.Element; copilot?: any} could you please help on function call
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>