Skip to content

Instantly share code, notes, and snippets.

@psamim
Last active February 9, 2018 14:43
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/e91aea6e5bbff6e45e5051313cfe56aa to your computer and use it in GitHub Desktop.
Save psamim/e91aea6e5bbff6e45e5051313cfe56aa to your computer and use it in GitHub Desktop.
const Note = props => <div>{props.note}</div>;
const SimpleNote = props => (
<div
style={{ color: props.selectedNoteIndex === props.index ? 'red' : 'blue' }}
>
<Note note={props.note} />
</div>
);
notes.map((note, index) => (
<SimpleNote note={note} index={index} selectedNoteIndex={selectedNoteIndex} />
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment