使用 react-native-router-flux 获取之前的场景 [英] Get previously scene with react-native-router-flux

查看:57
本文介绍了使用 react-native-router-flux 获取之前的场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将信息从上一页获取到当前页面.

I'm trying to get the information from the previous page to the current one.

我找到了这个解决方案,但它不起作用.使用 Actions 的属性 prevScene 但它返回与 currentScente 相同的字符串.为什么?

I find this solution, but it doesn't work. Use the property prevScene of Actions but it return the same string of currentScente. Why?

此外,我看到这个相对问题,但没有人回答.

Furthermore, I see this relative question, but no one has answered.

推荐答案

我有同样的问题,但找不到合适的道具.

I had the same question but I couldn't find the right prop for it.

所以我在导航到 currentScene 时传递了一个 from 道具并将其用于进一步处理,如下所示:

So I've passed a from props while navigating to the currentScene and used it for further processing, like this:

Actions.currentSceneKey({ from: 'prevSceneKey' });

console.log(this.props.from); // prevSceneKey

这篇关于使用 react-native-router-flux 获取之前的场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆