-
Notifications
You must be signed in to change notification settings - Fork 47.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Shallow renderer does not support React.memo #14807
Comments
Indeed; but it doesn’t throw when you try, and it seems to work fine in actual React - I’d expect it to work, or not work, the same everywhere. |
|
This doesn't seem to be isolated to class components, it fails with any component using |
React.memo(ClassComponent)
The relevant tests in the open enzyme PR only fail for class components, fwiw. |
Fixed in 16.8.5. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
In normal rendering, you can memoize a class-based component: https://jsfiddle.net/586ea3cx/
With the shallow renderer, it seems like you can't: https://jsfiddle.net/odj217Lv/1/
This might be blocking enzymejs/enzyme#1914, in which tests are failing with
Cannot call a class as a function
. (it's tough to repro stuff with the shallow renderer)The text was updated successfully, but these errors were encountered: