Created
January 17, 2016 03:07
-
-
Save sirbrillig/d4a04ab211f01d4024e1 to your computer and use it in GitHub Desktop.
Using React stateless components for quick prototyping
This file contains hidden or 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
import React from 'react'; | |
const Header = () => <div className="header"><img className="header__logo" src="/assets/logo.png" /><h1 className="header__title">My App</h1></div>; | |
const ToDoList = () => <div className="to-do-list"><h2 className="to-do-list__title">To Do</h2></div>; | |
const Controls = () => <div className="controls"><h2 className="controls__title">Controls</h2></div>; | |
const Footer = () => <div className="footer">Made by Me</div>; | |
export default React.createClass( { | |
render() { | |
return ( | |
<div className="app"> | |
<Header /> | |
<ToDoList /> | |
<Controls /> | |
<Footer /> | |
</div> | |
); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment