相关文章推荐

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

原理是利用ref在加载完后插入元素
其他前端有趣的例子和坑合集: https://github.com/wqhui/blog
直接预览: https://codepen.io/wqh/pen/YzyrNXB

const child =document.createTextNode("原生dom");
render(){
	<div ref={(nodeElement) => { nodeElement && nodeElement.appendChild(child ) }} /> 
 
推荐文章