小编Vis*_*iya的帖子

React Native Reload Screen A In Back 动作

我让 ScreenA 单击下一个 ScreenB 然后返回到 Screen A 不调用函数 componentWillMount()

ScreenA -> Next -> ScreenB -> Back() -> ScreenA

如何在背部动作中重新加载溃败屏幕

类 ScreenA

import React from "react";
import { Button, Text, View } from "react-native";

class ScreenA extends Component {
  constructor(props){
    super(props)
      this.state = {
        dataSource: new ListView.DataSource({
          rowHasChanged: (row1, row2) => row1 !== row2,
        })
      }
  }

  componentWillMount() {
        fetch(MYCLASS.DEMAND_LIST_URL, {
                method: 'POST',
                headers: {
                  'Accept': 'application/json',
                  'Content-Type': 'application/json',
                },                    
                body: JSON.stringify({
                  userId:'17'})
            })
            .then((response) => response.json())
            .then((responseData) => {
              if …
Run Code Online (Sandbox Code Playgroud)

iphone ios react-native

3
推荐指数
2
解决办法
2万
查看次数

标签 统计

ios ×1

iphone ×1

react-native ×1