Enzyme: TypeError: Cannot read property 'getPublicInstance' of undefined with react 16

Created on 5 Sep 2017  路  1Comment  路  Source: enzymejs/enzyme

I am trying out jest with react 16 and I get:

    TypeError: Cannot read property 'getPublicInstance' of undefined

      at WrapperComponent.getWrappedComponent (node_modules/enzyme/build/ReactWrapperComponent.js:95:31)
      at new ReactWrapper (node_modules/enzyme/build/ReactWrapper.js:100:34)
      at mount (node_modules/enzyme/build/mount.js:19:10)
      at Object.<anonymous> (src/components/common/PickUsersModal.spec.js:8:30)

when I try to mount my react component. shallow and render work fine

>All comments

enzyme is not yet compatible with react 16; as npm ls will show you.

You'll have to downgrade react or wait for enzyme v3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abe903 picture abe903  路  3Comments

potapovDim picture potapovDim  路  3Comments

modemuser picture modemuser  路  3Comments

amcmillan01 picture amcmillan01  路  3Comments

ahuth picture ahuth  路  3Comments