我使用React-Native-Router-Flux进行导航。我对action.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()}/>
)
}
}
有人知道如何使用它?
您可以根据需要传递道具。您可以在nodel_modules/react-native-router-flux/src/navigationstore.js
上找到道具详细信息_helloFunction = () => {
alert("Hello");
}
componentDidMount() {
Actions.refresh({
right: () => alert("Right"),
left: this._helloFunction
});
}