Closed simonjoom closed 7 years ago
Every element created by virtual-dom has a custom property named vchildren
, defaults to empty array, so it's not necessary to check whether node.vchildren
is existed or not.
Maybe the node created by virtual-dom had been removed or replaced manually?
the fact is after my patch , all works for loading my Facebook page, without i ve got an error .. for me node.vchildren is null and not empty array.. so i ve got a problem.
Ps the issue happened when i changed of page (of component) so i guess after the dom is destroyed I think you should to add this test, some users loading dynamic dom (like Facebook button or Facebook page) will be stuck like me
It's ok to add the test:)
cool 👍
First lucifer Thanks for react-lite who allow me to boost my web-site
I found an issue on generated iframe with react-lite , i use Sdk Facebook to integrate Facebook page in my react web app, all work good with normal react , but with react-lite: i constated an issue when i change of page on my menu
the problem was in destroyVelem; node.vchildren is null for an iframe /due maybe security stuff or maybe because iframe is generated dynamically/
So i propose you to add just one test if children exist With this test my website work with Facebook now ;))
function destroyVelem(velem, node) { var props = velem.props; console.log(node);console.log(node.vchildren); //--> null var vchildren = node.vchildren; var childNodes = node.childNodes; if(vchildren){ for (var i = 0, len = vchildren.length; i < len; i++) { destroyVnode(vchildren[i], childNodes[i]); } } detachRef(velem.refs, velem.ref, node); node.eventStore = node.vchildren = null; }