1// React-Javascript
2
3// Pass the children as either wrapping a html element around another
4// element.
5import React from 'react'
6
7class wrapEle extends React.Component {
8render() {
9 return (
10 <div>
11 // the "this" refers to the class Element so your accessing the props
12 // and grabbing the children
13 {this.props.children}
14 </div>
15 )}
16}
17
18class otherEle extends React.Component {
19render() {
20 return (
21 <wrapEle>
22 <div>
23 im the child element
24 </div>
25 </wrapEle>
26 )}
27}