-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Shallow API setContext should work without static contextTypes for React 16 #1913
Copy link
Copy link
Open
Description
According to the latest React documentation static contextTypes is no more needed for Context API to work - only static contextType (single form here) is needed https://reactjs.org/docs/context.html#classcontexttype
Current behavior
Enzyme for React 16 still requires static contextTypes to be defined to make setContext() work.
Expected behavior
Enzyme for React 16 should only rely on static contextType.
Your environment
API
- shallow
- mount
- render
Version
| library | version |
|---|---|
| enzyme | 3.7.0 |
| react | 16.6.1 |
| react-dom | 16.6.3 |
| react-test-renderer | --- |
| adapter (below) |
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 ( )
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels