-
Notifications
You must be signed in to change notification settings - Fork 47.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: False Positive "plain object" Warning #7718
Comments
I just checked, and lodash's To fix this issue, we could either import and use lodash's function, or copy the isPlainObject() implementation into the React codebase. |
Ugh. I think we should just revert this warning. It's caused frustration in many cases. |
👍 |
Fine by me. P.S. Sorry for the bizarre use case. I'm doing some pretty hacky stuff to isolate plugins inside an iframe. |
Okay, let's remove these lines and any associated tests: |
@spudly do you want to submit a PR for this? 😃 |
Sure, seems simple enough. I'll take care of it. |
Submitted #7724 |
There is a bug in the logic for determining if
props
is a plain object. This bug results in a false positive, flooding the console with hundreds of instances of this warning: "Expected props argument to be a plain object. Properties defined in its prototype chain will be ignored.".The code that's failing is in ReactElement.js, Line 210 in the v15.3.1 branch (line number is probably different in master)
This fails when the props object is created in one iframe, but uses an instance of React from another frame. Each browser window/tab/frame has it's own instance of the Object constructor. For instance,
document.querySelector('iframe').contentWindow.Object === Object
always results infalse
.Check out this demo, which shows the false-positive warning message.
The text was updated successfully, but these errors were encountered: