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

Potential bug with wrapped components? #79

Open
tomkelsey opened this issue Feb 27, 2022 · 0 comments
Open

Potential bug with wrapped components? #79

tomkelsey opened this issue Feb 27, 2022 · 0 comments

Comments

@tomkelsey
Copy link

Hi,

Using:

react-redux 7.2.6
react-router-dom 5.3.0
react-ssr-prepass 1.4.0

I've found if I export a component, "ComponentA" as:

withRouter(connect()(ComponentA)

I was getting the error:

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.

which appeared to originate from react-ssr-prepass.

I can "fix" this in my code by wrapping ComponentA differently:

connect()(withRouter(ComponentA))

I haven't got the capacity or knowledge to look into this further at the moment but wanted to highlight it in case it is an underlying bug that perhaps impacts others? (Apologies if this is just some weird quirk unique to my code!)

I did see an issue I thought might be related in the why-did-you-render repo - welldone-software/why-did-you-render#121

Where the fix appeared to be tweaking the order of the react component checks - welldone-software/why-did-you-render@983a18f

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