Home > database >  Passing parameters to routes
Passing parameters to routes

Time:04-25

I am currently fiddling with some exercise code, from what i seen in Result

CodePudding user response:

When you navigate to 'HalPedas' you are only passing through one parameter, 'JenisTopping'.

<View style={styles.card_footer}> 
  <Button 
    title="Pilih!" 
    color="#dc3545"
    onPress={() => navigation.navigate('HalPedas', {JenisTopping: "Telur Dadar"})} 
  /> 
</View>  

You can add an additional parameter as seen below

<View style={styles.card_footer}> 
  <Button 
    title="Pilih!" 
    color="#dc3545"
    onPress={() => navigation.navigate('HalPedas', {
      JenisTopping: "Telur Dadar",
      JennisMeil: "Something Else"
    })} 
  /> 
</View>  
  • Related