react-native-copilot
react-native-copilot copied to clipboard
Can't read property of 'measure' of undefined
I got error when I use this.props.start()
Anyone knows how to fix it?
@Jackyaung Please follow this template when opening a new issue.
Current Behavior I am also getting a similar error. I have added two steps to the walkthrough and when I click on "finish" at the second step it fails with the following error.

Environment Device: Android simulator react-native-copilot: 2.4.1 react-native-svg: 9.3.3 react-native: 0.57.8
Input Code:
class CalendarInternal extends React.PureComponent {
render() {
return (
<View style={styles.container} {...this.props.copilot}>
<View style={styles.header}>
<Text> This is inventory data </Text>
</View>
<CopilotStep name="inventory" order={2} text="Numbers below the date shows available inventory for all rooms">
<View style={styles.footer} {...this.props.copilot}>
<Text>2</Text>
</View>
</CopilotStep>
</View>
)
}
}
The above component is being used in another component which then calls this.props.start
like this:
class CalendarDayComponent extends React.PureComponent {
componentDidMount(){
this.props.start()
}
render(){
<CopilotStep name="hello" order={1} text="This is your current date inventory">
<CalendarInternal {...this.props}/>
</CopilotStep>
}
This happens randomly but I can reliably reproduce it when I uninstall the app and reinstall again.
https://github.com/okgrow/react-native-copilot/pull/105/files the above fix seems to work in my case.
Guys this issue is still actual in my case, this.props.start() crashes the app both onLoad and onClick with the same error screen with 'measure' of undefined.
For my case, If I put this condition
if ( !this.wrapper && this.wrapper.measure)
then those components, for my case, touchablewithoutfeedback
button is not responding.
This fix need more testing