Last active
February 9, 2018 14:43
-
-
Save psamim/e91aea6e5bbff6e45e5051313cfe56aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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