mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #1410 from spicyj/sih
Don't try to detach a detached node
This commit is contained in:
@@ -47,7 +47,10 @@ if (ExecutionEnvironment.canUseDOM) {
|
||||
// nodes when processing innerHTML, innerHTML on updated nodes suffers
|
||||
// from worse whitespace behavior. Re-adding a node like this triggers
|
||||
// the initial and more favorable whitespace behavior.
|
||||
node.parentNode.replaceChild(node, node);
|
||||
// TODO: What to do on a detached node?
|
||||
if (node.parentNode) {
|
||||
node.parentNode.replaceChild(node, node);
|
||||
}
|
||||
|
||||
if (html.match(/^[ \r\n\t\f]/)) {
|
||||
// Recover leading whitespace by temporarily prepending any character.
|
||||
|
||||
Reference in New Issue
Block a user