React Native – Render Multiple Variable

Cara untuk rendering multiple variable pada React Native kita dapat menggunakan simbol `` (terletak dibawah tombol Esc).

render() {
 let firstName = 'test';
 let lastName = 'name';
 return (
  <View style={styles.container}>
   <Text>{`${firstName} ${lastName}` } </Text>
  </View>
 );
}
Output: test name

Add a Comment

Your email address will not be published. Required fields are marked *