I am working with React Native and trying to get an image to show up based off title variable that is different for a list. I do not think I am handling the strings right with the JavaScript but not sure how to fix this. Any suggestions? It runs fine when I just hardcode the image source path so I know that is correct.
<View style={{ flex: 8 }}>
this.setState({
link: './assets/' + this.props.title + '.jpg',
});
<Image source={require(this.state.link)} style={[styles.images]} />
</View>