Skip to content

Instantly share code, notes, and snippets.

@psamim
Created February 9, 2018 14:24
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 psamim/829c841253e4eba2bf4755fd429a9332 to your computer and use it in GitHub Desktop.
Save psamim/829c841253e4eba2bf4755fd429a9332 to your computer and use it in GitHub Desktop.
import * as React from 'react';
const Note = props => (
<div style={{ color: props.selected ? 'red' : 'blue' }}>{props.note}</div>
);
const notes = [];
const selectedNoteIndex = 1;
notes.map((note, index) => (
<Note note={note} selected={index === selectedNoteIndex} />
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment