Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null is not an object (evaluating 'this.state.currentStep.target') #117

Open
rezapirighadim opened this issue May 5, 2019 · 7 comments · May be fixed by #197
Open

null is not an object (evaluating 'this.state.currentStep.target') #117

rezapirighadim opened this issue May 5, 2019 · 7 comments · May be fixed by #197

Comments

@rezapirighadim
Copy link

rezapirighadim commented May 5, 2019

I get some error of my app in bugsnag reporter that say's
null is not an object (evaluating 'this.state.currentStep.target')
this statement used in '/node_modules/@okgrow/react-native-copilot/src/hocs/copilot.js'

I never see this error in my test or development time .

it cause 10 time crash for 7 user in 2 day of our release.

Environment

OS: android version 8.1 and 9
react-native-copilot : "^2.4.1",
react-native: 0.57.8

@jeromecornet
Copy link

I'm not sure how to reproduce this consistently, but that has happened to me when a user navigates away from the screen before copilot renders the overlay.

@rezapirighadim
Copy link
Author

I'm not sure how to reproduce this consistently, but that has happened to me when a user navigates away from the screen before copilot renders the overlay.

I'm fix this problem by lock the screen with a View component that full all of the screen with transparent background and zIndex = 100 .
and remove this after user skip or pass all steps of walk through .

@export-mike
Copy link

I'm getting this same error null is not an object (evaluating 'this.state.currentStep.target') reported on our sentry issues.

@SiSa68
Copy link

SiSa68 commented Aug 5, 2020

I show copilot in child view, and I may remove child view in some case.
If I show copilot and then remove my child view (which CopilotStep component is inside it) I got null is not an object (evaluating 'currentStep.text') error, when user select the 'previous' button on tooltip
I was able to fix this problem by adding this code to the copilot HOC's render function:

    if(Object.values(this.state.steps).length === 0 && this.state.visible)
      this.stop();

@mohebifar Mohammad jaan, I hope you add the such a code to prevent this error

@mohebifar
Copy link
Owner

@SiSa68 Thanks for the proposed solution. Would you be able to create a PR?

@SiSa68
Copy link

SiSa68 commented Aug 5, 2020

@mohebifar I moved the code to the unregisterStep function(I think there is a better place for this), and I made PR

@cparello
Copy link

Did this ever get merged into the master as I still see this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants