Last active
November 3, 2018 12:12
-
-
Save gujc71/fbc061e4f62efbf35601887cd2fa624d to your computer and use it in GitHub Desktop.
redux_board
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 { connect } from 'react-redux'; | |
import BoardForm from './App_BoardForm'; | |
import BoardItem from './App_BoardItem'; | |
class App extends Component { | |
render() { | |
const { boards} = this.props; | |
return ( | |
<div> | |
<h3>React + Redux Board 1</h3> | |
<BoardForm/> | |
<table border="1"> | |
<tbody> | |
<tr align="center"> | |
<td width="50">No.</td> | |
<td width="300">Title</td> | |
<td width="100">Name</td> | |
<td width="100">Date</td> | |
</tr> | |
{ | |
boards.map(row => | |
(<BoardItem key={row.brdno} row={row} />) | |
) | |
} | |
</tbody> | |
</table> | |
</div> | |
); | |
} | |
} | |
let mapStateToProps = (state) => { | |
return { | |
boards: state.boards | |
}; | |
} | |
export default connect(mapStateToProps)(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment