aksonov / aksonov/react-native-mobx

Respond to the START of a Scene transition from within a Scene's child component

Đang mở
#8 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Objective-C
Star
224
Fork
37
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I asked this question on the react-native-router-flux repo and was given the following answer, though I'm not sure how it applies to react-native-mobx as I don't think there is an explicit reducer?

Question:

Is there a way to respond to the START of a Scene transition from within a Scene's child component?

I have audio playing which I stop within componentWillUnmount. componentWillUnmount is only triggered at the completion of a scene transition (and only when popping a scene, not pushing).

I'd like to be able to stop the audio as soon as the transition is triggered while keeping that logic encapsulated within the relevant component. (i.e. without creating global audio control logic)

Answer:

You can listen to the reducer - check the Example app for a way to do this.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.