React 组件传对象

class LikeButton extends Component {
constructor () {
super()
this.state = { isLiked: false }
}

handleClickOnLikeButton () {
this.setState({
isLiked: !this.state.isLiked
})
}

render () {
const wordings = this.props.wordings || {
likedText: '取消',
unlikedText: '点赞'
}
return (

)
}
}

你可能感兴趣的:(React 组件传对象)