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

Can't read property of 'measure' of undefined

Open Jackyaung opened this issue 5 years ago • 5 comments

I got error when I use this.props.start()

image Anyone knows how to fix it?

Jackyaung avatar Mar 14 '19 13:03 Jackyaung

@Jackyaung Please follow this template when opening a new issue.

mohebifar avatar Mar 14 '19 19:03 mohebifar

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.

Screenshot 2019-03-17 at 5 43 49 PM

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.

sankalpgoibibo avatar Mar 17 '19 12:03 sankalpgoibibo

https://github.com/okgrow/react-native-copilot/pull/105/files the above fix seems to work in my case.

sankalpgoibibo avatar Mar 17 '19 12:03 sankalpgoibibo

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.

ashotosipyan avatar Mar 27 '19 13:03 ashotosipyan

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

Abby3017 avatar Apr 27 '19 09:04 Abby3017