2017-12-13 21 views
0

私は自分のナビゲーションにreact-native-router-fluxを使用します。 Actions.refresh()に問題があります。私はそれを実行すると何も起こりません...アクション.refresh navigation

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()}/> 
     ) 
    } 
} 

誰かがそれをどのように使うのか知っていますか?

答えて

0

必要に応じて小道具を渡すことができます。あなたはnodel_modules/react-native-router-flux/src/navigationStore.jsの小道具の詳細を見つけることができます

_helloFunction = () => { 
    alert("Hello"); 
} 

componentDidMount() { 
    Actions.refresh({ 
    right:() => alert("Right"), 
    left: this._helloFunction 
    }); 
}