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

Breaks in React 16.3 when using the new Context API #4

Open
tshelburne opened this issue Mar 30, 2018 · 0 comments
Open

Breaks in React 16.3 when using the new Context API #4

tshelburne opened this issue Mar 30, 2018 · 0 comments

Comments

@tshelburne
Copy link

Relevant: https://reactjs.org/docs/context.html as of v16.3.0

I'm in the middle of a rush buildout of a product, so I don't have the time to dig in deep on this yet, but I wanted to make sure to register the issue. When I rewrote my app to use the new React.createContext approach instead of the legacy contextTypes, I started getting the following error:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
    at invariant (invariant.js:42)
    at createFiberFromElement (react-dom.development.js:5753)
    at reconcileSingleElement (react-dom.development.js:7531)
    at reconcileChildFibers (react-dom.development.js:7635)
    at reconcileChildrenAtExpirationTime (react-dom.development.js:7756)
    at reconcileChildren (react-dom.development.js:7747)
    at mountIndeterminateComponent (react-dom.development.js:8075)
    at beginWork (react-dom.development.js:8221)
    at performUnitOfWork (react-dom.development.js:10224)
    at workLoop (react-dom.development.js:10288)

The first non-React file in which the error appears is in node_modules/@sunny-g/cycle-react-driver/es2015/dom.js, line 95 - specifically when setState is called. At that line, the following message is displayed:

Warning: Can only update a mounted or mounting component. This usually means you called setState, replaceState, or forceUpdate on an unmounted component. This is a no-op.

Please check the code for the ReactCycleComponent component.

Once the product build has settled, I will be coming back to this, but if you know an easy fix in the meantime, that would be wonderful.

Thanks!

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

1 participant