Skip to content

Instantly share code, notes, and snippets.

@gujc71
Last active November 3, 2018 12:12
Show Gist options
  • Save gujc71/fbc061e4f62efbf35601887cd2fa624d to your computer and use it in GitHub Desktop.
Save gujc71/fbc061e4f62efbf35601887cd2fa624d to your computer and use it in GitHub Desktop.
redux_board
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