类似vue的函数插槽

 1 <script type="text/babel">
 2 
 3     function Son(props){
 4         return (
 5             <div>
 6                 {
 7                     props.children
 8                 }
 9             </div>
10         )
11     }
12     function Abox(){
13         return (
14             <Son>
15               <p>11111</p>
16             </Son>
17         )
18     }
19 
20 
21     ReactDOM.render(
22         <div className="box1">
23             <Abox></Abox>
24         </div>,
25         document.getElementById("root")
26     )
27 </script>
原文地址:https://www.cnblogs.com/LC123456/p/12118849.html