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

Warning: React.createElement: type is invalid when using withdata together with compose of react-apollo #6

Open
akolybelnikov opened this issue Dec 12, 2018 · 0 comments

Comments

@akolybelnikov
Copy link

If I compose a few queries in my _app.js to prefetch some data, I'm getting the above warning in the console.

const AppWithData = compose(
    resolvers.listSomething,
    resolvers.listSomethingElse,
    resolvers.listSomeOtherStuff
)(MyApp)

export default withData(AppWithData)

The full error:

index.js:2178 Warning: React.createElement: type is invalid -- expected a string (for built-in components)
 or a class/function (for composite components) but got: undefined. You likely forgot to export your 
component from the file it's defined in, or you might have mixed up default and named imports.

Check your code at _app.js:37.
    in MyApp
    in Query
    in Apollo(MyApp)
    in Query
    in Apollo(Apollo(MyApp))
    in Query
    in Apollo(Apollo(Apollo(MyApp)))
    in RenderPromisesProvider

Can anyone think of a better way to use withData together with compose ?

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