我有two component
S和我需要從children component
轉移stat
e將parent component
傳輸狀態從childComp到parentComp
class Parent Component {
this.state = {text: hahaha}
this.props.action(text, data)
<Children Component />
<button onClick={this.props.action(text, data)}
}
class Children Component {
this.state = {date: 12.12.12}
}
另一個有點棘手,這是我在父組件,它有兩個參數text and date
有redux-action
,總之,當我點擊按鈕,我需要從childComp
轉移state
到parentComp
,然後創建兩個參數在parentComp
行動。那我該怎麼做呢?