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

Cannot set property 'parentContext' of undefined #70

Closed
creeperyang opened this issue Sep 1, 2016 · 5 comments
Closed

Cannot set property 'parentContext' of undefined #70

creeperyang opened this issue Sep 1, 2016 · 5 comments

Comments

@creeperyang
Copy link
Contributor

ReactDOM.render(<MyComponent />, container)

get error:

Uncaught TypeError: Cannot set property 'parentContext' of undefined
function initVcomponent(vcomponent, parentContext, namespaceURI) {
        var Component = vcomponent.type;
        var props = vcomponent.props;
        var uid = vcomponent.uid;

        var componentContext = getContextByTypes(parentContext, Component.contextTypes);
        var component = new Component(props, componentContext);
        var updater = component.$updater;
        var cache = component.$cache;
            // cache is undefined!
        cache.parentContext = parentContext;
@Lucifier129
Copy link
Owner

Lucifier129 commented Sep 1, 2016

Can you add a simple demo for producing this problem?

Something maybe relate with it. if you use babel6 to transform es2015 classes and run in IE9/10, there is a trouble super constructor would not be calling.

@creeperyang
Copy link
Contributor Author

I use babel6 to transform es2015 classes, but I run code in chrome 52.

@creeperyang
Copy link
Contributor Author

@Lucifier129 you are right. I removed es6 class syntax and the error gone.

However, it's disappointed if not support class feature...

@Lucifier129
Copy link
Owner

Lucifier129 commented Oct 8, 2016

FYI #75

@creeperyang
Copy link
Contributor Author

great

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

No branches or pull requests

2 participants