aksonov / aksonov/react-native-router-flux

Problem when trying to pass props to another Scene whis is inside a Drawer

未关闭
#3,729 0 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
8.9k
派生
2.1k
PR 合并指标
30 天内没有已合并 PR

描述

### Version
Tell us which versions you are using:

- react-native-router-flux v4.2.0
- react v16.13.1
- react-native v0.63.4

### Expected behaviour
Having access to props in the view you navigated to.

### Actual behaviour
No props are passed to the scene you navigated to.

### Steps to reproduce
1. Try to navigate to another **Scene** which is nested in a **Drawer**.
2. If the **Scene** is the child of a **Drawer** no props are passed. If you try to navigate to another scene which is not the child of a **Drawer** then props are passed.
3. I also discovered that props are passed if the **Drawer** or the **Scenes** inside it have the attribute **wrap={false}**

### Reproducible Demo
My router component:
```












```
Scan Scene:
`Actions.pack({test: "test"})`

Pack Scene:
`console.log(props) //no "test" property in props`

But if I do:
Scan Scene:
`Actions.test({test: "test"})`

Test Scene:
`console.log(props) //props has "test" property`

I thought I went insane today debugging this, but I've found two workarounds:
1. As described above if you add the attribute **wrap={false}** to the **Drawer** you can pass the props.
2. You can wrap the **Scenes** in the **Drawer** with a "wrapper Scene" as so:
```













```
then

Scan Scene:
`Actions.pack({test: "test"})`

Pack Scene:
`console.log(props) //props has "test" property`

Is this a bug or did I do something wrong?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。