Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Cannot read property 'render' of undefined #63

Closed
thomas-jeepe opened this issue Jun 6, 2016 · 2 comments
Closed

Cannot read property 'render' of undefined #63

thomas-jeepe opened this issue Jun 6, 2016 · 2 comments

Comments

@thomas-jeepe
Copy link

thomas-jeepe commented Jun 6, 2016

So I was switching my project to typescript and in this process I got Cannot read property 'render' of undefined.

After following the stack trace, I ended up in this line.

Debugging showed that componentClass.prototype was undefined, causing it to throw on trying to get a property on undefined. Changing the line to the below fixed everything and all components worked.

if (typeof componentClass === "function" && !componentClass.prototype && !componentClass.isReactClass && !React.Component.isPrototypeOf(componentClass)) {

This is the stack trace, tsconfig, and relevant files

Im not sure if this is a bug on my end or on mobx-react. Right now the "fix" I am using is replacing the line of code, but that isn't very maintainable.

@mweststrate
Copy link
Member

I just released mobx-react@3.3.1, could you verify whether this solves the issue? Spotted a potential error in the check indeed.

@thomas-jeepe
Copy link
Author

Just upgraded to 3.3.1 and it fixed it thanks a ton!

@github-actions github-actions bot mentioned this issue Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants