enzyme-adapter-preact
enzyme-adapter-preact copied to clipboard
Invariant Violation: ReactShallowRenderer render(): Invalid component element.
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
+1 Have the same issue
Working on a fix for this, should have a merge request ready soon
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.