Validate node nesting structure#735
Conversation
Fixes facebook#767. This essentially reverts 738de8c. We could store some sort of flag to silence the console error here but since we've made significant improvements in markup wrapping, this error is fairly rare now. We'll also have validation of node structure soon in facebook#735.
|
@sebmarkbage Just updated with a pretty complete validateNodeNesting function. |
|
Got notified by Someone else came across it (and I think this PR is the fix?). |
|
Yeah, this will warn when putting a |
src/core/ReactDOMComponent.js
Outdated
There was a problem hiding this comment.
This is always an array, right? You can just use .forEach and .join. No need for the added dependencies and extra helper module
There was a problem hiding this comment.
In the case of dangerouslySetInnerHTML it's a string. I can get rid of that and make it an array always if you prefer.
There was a problem hiding this comment.
(@sebmarkbage Just checking in on this.)
|
👍 Just ran into this while playing around with React myself. Pretty sure our production code got this problem as well ;) |
This is a better version of facebook#644. Fixes facebook#101.
|
After talking with @sebmarkbage, I'm going to close this out since I think we don't want to do this this way. There's work being done to make this possible without inspecting markup. |
|
I just wanted to throw in my two cents that I came across this issue today as a react n00b and would've been completely lost without this post from @spicyj I found on the google group. I'm not sure how high of a priority this kind of a warning is but it is helpful to people who are new to the project. |
|
@mikemorton If #1550 is agreed upon then it should provide us with the ability to cheaply warn/throw when the browser mucks with the DOM. |
Nicer version of facebook#644 and facebook#735. Fixes facebook#101. Context is neat.
This is a better version of #644. Fixes #101.