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 = list_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 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
| class List extends Component { | |
| render() { | |
| // Create variable with mapped data | |
| let list_items = list_data.map(function(item, index) { | |
| return ( | |
| <ListItem text={item} /> | |
| ) | |
| }) |
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 List extends Component { | |
| render() { | |
| // Create variable with mapped data | |
| let list_items = list_data.map(function(item, index) { | |
| return ( | |
| <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'; | |
| let list_data = [ | |
| "Cat", | |
| "Dog", | |
| "Fish", | |
| "Parrot", | |
| "Rabbit" | |
| ] |
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 ListItem extends Component { | |
| render() { | |
| return ( | |
| <li>Item</li> | |
| ) | |
| } | |
| } | |
| class List extends Component { | |
| render() { |
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 List extends Component { | |
| render() { | |
| return ( | |
| <div> | |
| <h2>List title</h2> | |
| <ul> | |
| </ul> | |
| </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
| class List extends Component { | |
| render() { | |
| return ( | |
| <h2>List title</h2> | |
| <ul> | |
| </ul> | |
| ) | |
| } | |
| } |
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 List extends Component { | |
| render() { | |
| return ( | |
| <h2>List title</h2> | |
| ) | |
| } | |
| } |
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 { | |
| } | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <div> | |
| <h1>Hello React!</h1> |