Error diving through react-redux connected components
See original GitHub issueCurrent behavior
I get a ShallowWrapper::dive() can only be called on components
error when trying to .dive()
through a component wrapped in react-redux
’s connect
function.
See demo at https://codesandbox.io/s/v33j14k0jl
Expected behavior
I should be able to dive through connected components and shallow render the component’s contents. I know this worked as of react-redux
5.1.1
. They have transitioned to the new the new React Context API since. If this belongs as an issue in the react-redux
repo, I’ll recreate it there.
Your environment
Running demo on CodeSandbox
I appreciate the recent work to get the new Context APIs working and they have worked for every other dependency I’ve upgraded in our React Native app (react-i18next
was a crucial one). However something seems different with react-redux
. They could have a different/unique implementation. Thanks for looking into this 😃
API
- shallow
- mount
- render
Version
library | version |
---|---|
enzyme | 3.9.0 |
react | 16.6.6 |
react-dom | 16.8.6 |
react-test-renderer | Not explicitly installed |
adapter (below) | 1.12.1 |
Adapter
- enzyme-adapter-react-16
- enzyme-adapter-react-16.3
- enzyme-adapter-react-16.2
- enzyme-adapter-react-16.1
- enzyme-adapter-react-15
- enzyme-adapter-react-15.4
- enzyme-adapter-react-14
- enzyme-adapter-react-13
- enzyme-adapter-react-helper
- others ( )
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (5 by maintainers)
Still something is wrong with
react-redux
. I suppose it is partially aboutuseMemo
asconnect
with{ pure: false }
,.text()
produces different output.https://codesandbox.io/s/old-currying-4lme5
Will create new issue as soon as figure out some more particular test case.
Ah ok. That makes sense. I saw the adapter releases go out afterwards and guess I assumed the code changes were only in the adaptors. Thanks.