Created
November 3, 2018 12:17
-
-
Save gujc71/cf9a27078f84d5dd646c3533ac6fdd40 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 { board_read, board_remove } from './App_reducer' | |
class BoardItem extends Component { | |
handleUpdateForm = (brdno) => { | |
this.props.dispatch(board_read(brdno)); | |
} | |
render() { | |
const row= this.props.row | |
return( | |
<tr> | |
<td>{row.brdno}</td> | |
<td><a onClick={() => this.handleUpdateForm(row.brdno) }>{row.brdtitle}</a></td> | |
<td>{row.brdwriter}</td> | |
<td>{row.brddate.toLocaleDateString('ko-KR')}</td> | |
<td><a onClick={() => { this.props.dispatch(board_remove(row.brdno)) }}>X</a></td> | |
</tr> | |
); | |
} | |
} | |
export default connect()(BoardItem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment