You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rendering a Provider and its Consumer directly (with no surrounding elements), a propType warning gets emitted.
To Reproduce
Steps to reproduce the behavior:
importReactfrom'react';importReactDOMfrom'react-dom';import{mount}from'enzyme';const{ Provider, Consumer }=React.createContext();constelement=(<Providervalue="hello world"><Consumer>{greeting=>greeting}</Consumer></Provider>);ReactDOM.render(element,document.createElement('div'));// No warning, renders as expectedmount(element);// renders as expected, but yields the following warning:/*Warning: Failed prop type: Invalid prop `Component` supplied to `WrapperComponent`. in WrapperComponent*/mount(<div>{element}</div>);// No warning, renders as expected
Expected behavior
I'd expect no warning to be emitted.
Desktop (please complete the following information):
OS: macOS 10.13.6
Versions:
Node 8.11.3
react 16.4.2
react-dom 16.4.2
enzyme 3.4.0
enzyme-adapter-react-16 1.2.0
The text was updated successfully, but these errors were encountered:
I can't reproduce the issue anymore after updating enzyme to 3.5.0 and enzyme-adapter-react-16 1.3.0. I'm going to go ahead and close this since it appears to have been resolved 🙂
Describe the bug
When rendering a Provider and its Consumer directly (with no surrounding elements), a propType warning gets emitted.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect no warning to be emitted.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: