小编AS1*_*S10的帖子

useEffect 内的函数没有被 deepLink 调用

下午好,我正在尝试使用 React Router Flux 为 React Native 设置 DeepLinking,但 useEffect 中的函数似乎没有运行。我相信这可能是因为它没有正确地获得状态。当我访问 flow_id 的 URL 时,它只会在 UI 中呈现我在 URL 中输入的内容,但该函数不会运行。它应该将 flow_id 与 scene_key 相匹配,并使用正确的流和子流打开场景。任何指导将不胜感激。

import React, { useEffect } from 'react';
import { Linking, View, Text } from 'react-native';
import { Actions } from 'react-native-router-flux';
import { useSelector, useDispatch } from 'react-redux';
import Router from '../Router';
import reducers from '../reducers';
import * as ActionCreators from '../actions';
import * as Globals from '../library/utils/globals';
import {
  selectFlow,
  flowsFetch,
  subFlowsFetch,
} from '../actions';

const …
Run Code Online (Sandbox Code Playgroud)

deep-linking reactjs react-native redux react-redux

5
推荐指数
1
解决办法
874
查看次数

标签 统计

deep-linking ×1

react-native ×1

react-redux ×1

reactjs ×1

redux ×1