-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New React context API adds new tag types #1509
Copy link
Copy link
Closed
Description
The new API for context, publicly released just a few hours ago in the React 16.3 alpha, adds new tag types for the Provider and Consumer components that are returned from the createContext function.
When updating my module to use the new API, I get an unknown node error from the ReactSixteenAdapter.js:
Enzyme Internal Error: unknown node with tag 13
I went in and took a stab at updating the adapter, and found that the Consumer prop has another new tag type, 12.
I added the following lines:
+ var ContextProvider = 13
+ var ContextConsumer = 12and tried adding cases for both of those in the module's switch statement, but none of the existing case handling options worked to get my tests passing again.
Environment
API
- shallow
- mount
- render
Version
| library | version |
|---|---|
| Enzyme | 3.3.0 |
| React | 16.3.0-alpha.0 |
Adapter
- enzyme-adapter-react-16
- enzyme-adapter-react-15
- enzyme-adapter-react-15.4
- enzyme-adapter-react-14
- enzyme-adapter-react-13
- enzyme-adapter-react-helper
Reactions are currently unavailable