Last active
April 28, 2022 05:47
-
-
Save purezen/e421917fca4c05bb2c05 to your computer and use it in GitHub Desktop.
App based on react-transform-boilerplate
This file contains 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 TaskList from './TaskList'; | |
export default class App extends Component { | |
constructor(props) { | |
super(props) | |
this.state = { tasks: [ | |
{ id: 1, taskText: "task 1" }, | |
{ id: 2, taskText: "task 2" } | |
] | |
} | |
} | |
render() { | |
return ( | |
<div> | |
<h4>Story-app</h4> | |
<TaskList tasks={this.state.tasks} /> | |
</div> | |
); | |
} | |
} |
This file contains 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'; | |
export default class TaskList extends Component { | |
render() { | |
var listItems = this.props.tasks.map(function(task) { | |
return <p>{task.taskText}</p>; | |
}); | |
return ( | |
<div> | |
{listItems} | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment