aksonov / aksonov/react-native-router-flux

Updating drawer title or the first scene it displays via props

未關閉
#3,348 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
8.9k
分支
2.1k
PR 合併指標
30 天內沒有已合併 PR

描述

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

- react 16.3.1
- react-native 0.57.4

Hello, I am new to react-native-router-flux and react-native as well. I would like to know how can I change the title of my drawer (which holds as the first scene an album list with a default title):

![image](https://user-images.githubusercontent.com/26840798/48098782-ac5adc00-e1eb-11e8-8085-94789abf0957.png)

When I am in the Genre component, I select a genre and takes me back to the AlbumList component. Now, when I do that I would like to update the title of the drawer or the AlbumList component. I tried "Actions.refresh({ title: genre })" in the ComponentDidmount function on both the AlbumList component and the Menu Component which is the drawer passing a prop with the mapStateToProps on both.

![image](https://user-images.githubusercontent.com/26840798/48099043-59cdef80-e1ec-11e8-9a8c-33f3f1703db2.png)

I realize that this only works if the Actions.refresh is whithin some other function that is called when I press a button for instance in the same component.

![image](https://user-images.githubusercontent.com/26840798/48098860-e9bf6980-e1eb-11e8-87e9-a859536a8e69.png)

![image](https://user-images.githubusercontent.com/26840798/48098931-16738100-e1ec-11e8-922b-9660c0472b6c.png)

![image](https://user-images.githubusercontent.com/26840798/48098957-1f645280-e1ec-11e8-837a-df873a303103.png)

![image](https://user-images.githubusercontent.com/26840798/48098974-28552400-e1ec-11e8-90b2-7595de6e42ed.png)

I don't know what is the right approach. I would appreciate any help. Thank you!

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。