-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
TypeError: Cannot read property 'IsValidated' of undefined #80
Comments
Got the same problem |
Same here.. |
same here.. |
same here... |
I believe I have traced the probable cause of these errors. Turns out that there is code that checks a react component's prototype for an The problem is that arrow functions if you had a component like this, you would throw
Long story short, this was hard to track down because of Babel - Older presets like es2015 (like used in this library, including its tests) will transpile this component like this:
Notice the change to a regular function? This function has a prototype, and will not throw. Now, say you upgrade an existing app using react-stepzilla to Babel 7, and use preset-env for modern browsers. This is now your transpiled component. And boom, no prototype so this method throws.
The easiest workaround here is to use a standard Realistically, this isn't much of a permanent solution. A safer property access on the react components, not assuming a prototype property exists should be enough to fix this bug. https://github.com/newbreedofgeek/react-stepzilla/blob/master/src/main.js#L33 I would also recommend a different babel preset for your tests, possibly leaving arrow functions intact. They are pretty universally well supported now |
Interesting, thanks for detailed debug in the above comment. Yes, I believe it is caused due to the pure component. I will look at a possible fix as I’m working on the Redux demo as part of #134 I can’t recall if any of the other demo code used pure compenets and the older Babel was allowing it to work?? |
Mmmm just realised that isValidated as a Static might do the trick, but not sure if Static is supported in pure components? |
hi i am facing the same issue. Any updates? |
Is this supposed to be fixed now? I've just tried using the component installing it via npm, and see the same crash. I'm not using functional components. What could be wrong? |
@dk4210, today, I had the same problem and after some debugging on the code, I realized that the package(react-stepzilla) cannot find the isValidated property since it cannot find the step component's prototype. This was because my component, that is used in step, was a functional component
I changed the component to class one:
Now, the error has gone. Maybe this help you |
Hello I see that other people were having this issue but I didn't see a clear answer.
the steps work great, its the validation I'm having an issue with. Please advise.
Here's the complete error
I have a component (Step1) and here is the code
Here's my code for my dashboard (Kinda like your example.js)
The text was updated successfully, but these errors were encountered: