i have saved images names in state but when i try to show them its giving the error 'Invalid call require('./assets/'+this.state.img1)' ( but when i put the image name directly in source its start working. Like : i have also alert the state its having the same image name.
render() {
return (
<TouchableOpacity onPress={this.onItemPressed} style={styles.container}>
<Image
style={styles.stretch}
source={require('./assets/'+this.state.img1)}
/>
<Image
style={styles.stretch}
source={require('./assets/'+this.state.img2)}
/>
</TouchableOpacity>
)
}