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
    
  
  
    
  | export default ListItem; | 
  
    
      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
    
  
  
    
  | export default List; | 
  
    
      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 React, { Component } from 'react'; | |
| import ListItem from './ListItem'; | |
| ... | 
  
    
      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 React, { Component } from 'react'; | |
| import List from './components/List'; | |
| ... | 
  
    
      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 React, { Component } from 'react'; | |
| class ListItem extends Component { | |
| render() { | |
| return ( | |
| <li>{this.props.text}</li> | |
| ) | |
| } | |
| } | 
  
    
      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 React, { Component } from 'react'; | |
| class List extends Component { | |
| render() { | |
| // Create variable with mapped data | |
| let list_items = this.props.data.map(function(item, index) { | |
| return ( | |
| <ListItem text={item} key={index} /> | |
| ) | 
  
    
      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
    
  
  
    
  | // Create variable with mapped data | |
| let list_items = this.props.data.map(function(item, index) { | |
| return ( | |
| <ListItem text={item} key={index} /> | |
| ) | |
| }) | 
  
    
      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
    
  
  
    
  | class App extends Component { | |
| render() { | |
| return ( | |
| <div> | |
| <h1>List of lists</h1> | |
| <h2>Top animals</h2> | |
| <List data={top_animals} /> | |
| <h2>Other animals</h2> | |
| <List data={other_animals} /> | |
| </div> | 
  
    
      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
    
  
  
    
  | let top_animals = [ | |
| "Cat", | |
| "Dog", | |
| "Fish", | |
| "Parrot", | |
| "Rabbit" | |
| ] | |
| let other_animals = [ | |
| "koala", | 
  
    
      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
    
  
  
    
  | class App extends Component { | |
| render() { | |
| return ( | |
| <div> | |
| <h1>List of lists</h1> | |
| <h2>Top animals</h2> | |
| <List /> | |
| <h2>Other animals</h2> | |
| <List /> | |
| </div> |