1
mobx reactがcomponentWillReactという新しいライフサイクルを提供していることをドキュメントで読んでいます。しかし、私のクラスはrender関数のmobxの変化に反応するようです。私の店が変わると、componentWillReactは決して引き起こされません。MobX componentWillReact not firing
私は小道具として「次へ」を送ります。このアプリはmobxを使わない。
import { observer } from 'mobx-react';
@observer class QuickShopNew extends Component {
componentWillReact() {
console.log(this.props.store.next);
}
render(){
//console.log(this.props.store.next);
return(
<div>
</div>
)
}
}
にsimple working exampleがどのように読むことができます
あなたはあなたの質問であなたの 'store'が含まれてもらえますか?それは何が間違っているのかという手がかりを与えるかもしれません。 – Tholle