Skip to content

Instantly share code, notes, and snippets.

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