Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
Can't trigger action on click - react-native-router-flux

I'm creating my app with react-native and also using react-native-router-flux for routing. I have this piece of code in my router.js file and trying to add a button on the right that once is clicked it should trigger sayHello action.

const CoinImg = () => {
  return (
    <View>
      <Image style={{width:20, height:20}} source={require('./myyImage.png')}/>
    </View>
  );
};

<Scene
          onRight={() => Actions.sayHello()}
          renderRightButton={() => { return <CoinImg />; }} 
          key="firstComponent"  
          component={FirstComponent} 
          title=" " 
        />

The above code can correctly show image on the right but when I click that image nothing happens (action sayHello() is not triggered). Instead, If I have the following code the action is triggered.

<Scene 
          onRight={() => Actions.sayHello()}
          rightTitle="Print Hello"
          key="SecondComponent"
          component={SecondComponent}
          renderTitle={() => { return <CoinImg />; }} 
        />

dependencies versions:

"react": "15.3.2",
"react-native": "0.34.1",
"react-native-router-flux": "^3.35.0"
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda