Closed coclauso closed 3 years ago
@coclauso i'm very confused - you should never define one component inside another. What happens if you hoist Component2
outside of Component
?
nvm, that's a red herring (but seriously, hoist that component out) - i've reproduced the problem.
Current behavior
mount()
fails withTypeError: Cannot read property 'current' of undefined
. Note that this is similar to #2004 , but no causes described there seem to apply.In this case, it seems to be triggered by a specific combination of lazy component and useState:
Zipfile with fully working repro project is attached: repro-enzyme-issue.zip
Expected behavior
Test doesn't fail with this error.
Your environment
nodejs v14.17.3
API
Version
Adapter