【问题标题】:Triggering an event when a ReactNative app is opened打开 React Native 应用程序时触发事件
【发布时间】:2015-09-30 20:56:47
【问题描述】:

有谁知道在打开响应式应用程序时如何触发事件?例如。每当用户再次打开应用时刷新数据。

【问题讨论】:

    标签: reactjs react-native


    【解决方案1】:

    【讨论】:

    • 我认为此页面已更改。你做了什么?
    【解决方案2】:

    转到导航开始的那个文件。

        import React, { Component } from 'react';
        import { Root } from './config/router';
    
        class Index extends Component {
            componentWillMount(){
                 //your event function code
    }
            render() {
                return <Root />;
            }
        }
    
    export default Index;
    
    Here Root contains all screens where navigation starts.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多