React
by ashraffayad
HTML
<div id="app"></div>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
.grid {
display: grid;
grid-gap: 5px;
grid-template-columns: repeat(7, 1fr);
background: #e2e4e7;
padding: 10px;
border-radius: 3px;
}
.grid > span {
border-radius: 3px;
background: white;
color: #888;
font-weight: bold;
text-align: center;
line-height: 40px;
}
React
const items = [];
for (let i = 1; i < 50; i++) {
items.push(i);
}
class TodoApp extends React.Component {
constructor(props) {
super(props)
this.state = {
items
}
}
render() {
return (
<div className="grid">
{this.state.items.map(item => (
<span key={item}>{item}</span>
))}
</div>
)
}
}
ReactDOM.render(<TodoApp />, document.querySelector("#app"))
// https://www.facebook.com/groups/reactjs.co/permalink/2481667195181624/