Skip to content

Instantly share code, notes, and snippets.

@sirbrillig
Created January 17, 2016 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sirbrillig/d4a04ab211f01d4024e1 to your computer and use it in GitHub Desktop.
Save sirbrillig/d4a04ab211f01d4024e1 to your computer and use it in GitHub Desktop.
Using React stateless components for quick prototyping
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