Created
December 28, 2018 07:47
-
-
Save andreconghau/6c565e0fc656ff4cb2fd362548956793 to your computer and use it in GitHub Desktop.
Ex about Child Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Header extends React.Component { | |
render() { | |
return ( | |
<div className="header"> | |
<div className="fa fa-more"></div> | |
<span className="title">Timeline</span> | |
<input | |
type="text" | |
className="searchInput" | |
placeholder="Search ..."/> | |
<div className="fa fa-search searchIcon"></div> | |
</div> | |
) | |
} | |
} | |
class Content extends React.Component { | |
render() { | |
return ( | |
<div className="content"> | |
<div className="line"></div> | |
<div className="item"> | |
<div className="avatar"> | |
<img alt='doug' src="http://www.croop.cl/UI/twitter/images/doug.jpg"/> | |
</div> | |
<span className="time"> An hour ago </span> <span>Ate lunch</span></div> | |
</div> | |
) | |
} | |
} | |
class App extends React.Component { | |
render() { | |
return ( | |
<div className="notificationsFrame"> | |
<div className="panel"> | |
{/*Todo something*/} | |
<Header/> | |
<Content/> | |
</div> | |
</div> | |
) | |
} | |
} | |
var mountApp = document.querySelector('#app'); | |
ReactDOM.render(<App/>, mountApp); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment