首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Actions.refresh导航

Actions.refresh导航
EN

Stack Overflow用户
提问于 2017-12-13 21:46:25
回答 1查看 1.2K关注 0票数 1

我使用react-native-router-flux进行导航。我对Actions.refresh()有一个问题。当我执行它的时候什么也没发生。

代码语言:javascript
复制
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()}/>
        )
    }
}

有人知道怎么用吗?

EN

回答 1

Stack Overflow用户

发布于 2017-12-14 01:52:06

你可以根据需要传递道具。你可以在nodel_modules/react-native-router-flux/src/navigationStore.js上找到道具的详细信息

代码语言:javascript
复制
_helloFunction =  () => {
  alert("Hello");
}

componentDidMount() {
    Actions.refresh({
    right: () => alert("Right"),
    left: this._helloFunction
    });
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47794529

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档