我使用react-native-router-flux进行导航。我对Actions.refresh()有一个问题。当我执行它的时候什么也没发生。
import React, { Component } from 'react';
import {
View,
Text,
Button,
} from 'react-native';
export default class Picture extends Component {
constructor(props) {
super(props);
console.log("Constructor picture")
}
componentWillMount() {
console.log('Will mount picture')
}
componentWillUpdate() {
console.log("Will Update picture")
}
componentWillUnmount() {
console.log("will Unmont picture")
}
render() {
console.log("render Picture")
return (
<Button title='refresh' onPress={() => Actions.refresh()}/>
)
}
}有人知道怎么用吗?
发布于 2017-12-14 01:52:06
你可以根据需要传递道具。你可以在nodel_modules/react-native-router-flux/src/navigationStore.js上找到道具的详细信息
_helloFunction = () => {
alert("Hello");
}
componentDidMount() {
Actions.refresh({
right: () => alert("Right"),
left: this._helloFunction
});
}https://stackoverflow.com/questions/47794529
复制相似问题