Skip to content

Instantly share code, notes, and snippets.

@bloodyowl

bloodyowl/.js Secret

Created March 14, 2018 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bloodyowl/642f056c54ed3f760c11d0246404cf96 to your computer and use it in GitHub Desktop.
Save bloodyowl/642f056c54ed3f760c11d0246404cf96 to your computer and use it in GitHub Desktop.
import React from "react";
import ReactDOM from "react-dom";
const Title = ({ children }) => <h1 className="Title">{children}</h1>
const Section = ({ title, children }) => (
<div className="Section">
<Title>{title}</Title>
{children}
</div>
);
const Tag = ({ label }) => <span className="Tag">{label}</span>
const Project = ({ project }) => (
<div className="Project">
<h2 className="Project-title">{project.title}</h2>
{project.tags.map(tag => <Tag key={tag.id} label={tag.label} />)
{project.description}
</div>
);
ReactDOM.render(
<div>
<Section title="Project">
{projects.map(project => <Project key={project.id} project={project} />)}
</Section>
</div>,
document.querySelector("#app-root")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment