Skip to content

Error: Element type is invalid when using Parallax v9.0.0-rc.3 #1090

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

Closed
imyjimmy opened this issue Jul 24, 2020 · 2 comments · Fixed by #1330
Closed

Error: Element type is invalid when using Parallax v9.0.0-rc.3 #1090

imyjimmy opened this issue Jul 24, 2020 · 2 comments · Fixed by #1330
Labels
template: bug This issue might be a bug
Milestone

Comments

@imyjimmy
Copy link

imyjimmy commented Jul 24, 2020

I was using react-spring v8, following along the docs for Parallax when I ran into this issue and kept reading:

@azizhk The current v9 beta exports the renderprops API from react-spring (no /renderprops required), and react-spring/web is identical to react-spring, so you should be able to do:

import { Spring } from 'react-spring/web.cjs'

Not sure what the solution for v8 is. I'm not contributing to it.

Originally posted by @aleclarson in #601 (comment)

So I decided to try rc.3. My parallax looks like this:

<Parallax pages={1} scrolling={true}>
          <ParallaxLayer offset={0}><Content></ParallaxLayer>
</Parallax>

and my import statement: import { Parallax, ParallaxLayer } from 'react-spring'

But on yarn dev I get the following error:

Error: Element 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.

I've ruled out other causes because it compiles when I comment out Parallax. Looks like I need to pass in a prop that used to be optional...should I be passing in the ref prop? Next.js v9.4.4 on Node 14.4.0

@aleclarson aleclarson added template: bug This issue might be a bug v9 labels Jul 24, 2020
@imyjimmy
Copy link
Author

Update: I resolved it by using react-spring/addons.cjs on react-spring v7.2.8

@aleclarson
Copy link
Contributor

Reopening so I remember to fix this in v9

@aleclarson aleclarson reopened this Jul 25, 2020
@joshuaellis joshuaellis linked a pull request Mar 18, 2021 that will close this issue
@joshuaellis joshuaellis added this to the v9.0.0 milestone Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template: bug This issue might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants