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

Invariant Violation: ReactShallowRenderer render(): Invalid component element. #20

Open
jahilldev opened this issue May 16, 2018 · 3 comments

Comments

@jahilldev
Copy link

jahilldev commented May 16, 2018

I've got everything setup according to your docs however whenever I attempt to shallow render a very simple class based component I get the following error:

Invariant Violation: ReactShallowRenderer render(): Invalid component element.

For clarity I'm using:

"typescript": "2.8.3"
"preact": "8.2.9"
"mocha": "^5.1.1"
"enzyme": "^3.3.0"
"enzyme-adapter-preact": "^0.2.0"

I've put together a repo illustrating this here:
https://github.com/jhdevuk/typescript-preact-enyme

@awinogradov @sanpoChew @aweary

Thanks

@bdzhilka
Copy link

+1 Have the same issue

@sanpoChew
Copy link
Contributor

Working on a fix for this, should have a merge request ready soon

@orzechowskid
Copy link

I still get this error using jest 23.6.0 , enzyme 3.8.0 , and enzyme-preact-adapter 0.2.0 . One not-great workaround is to import React from 'preact-compat'; instead of from 'preact' in test files.

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

Successfully merging a pull request may close this issue.

4 participants