Last active
February 9, 2018 14:21
-
-
Save psamim/e775cc100db7a6577d8779d459499838 to your computer and use it in GitHub Desktop.
Example 1
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
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