aksonov / aksonov/react-native-mobx

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

Aberta
#8 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Objective-C
Estrelas
224
Forks
37
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.