在react native中使用mobx时初始化页面数据

1.说明:在react native中使用mobx时退出当前页面后,重新进入该页面时,初始化页面数据(多用于当前页面有筛选条件时,退出页面后mobx中数据保留筛选后的状态)

2直接上代码:

class xxxxx extends PureComponent {
constructor(props) {
super(props);
store.xxxxxx();
this.state = {
};
}
componentWillMount() {
store.yyyyy= xxxxx; //yyyyy代表你mobx中观测的变量, xxxxx代表你想初始化的值
store.yyyyy= xxxxx;
}
}