My initial image source is something like this
<Image
style={[styles.iconArea,
focused ? styles.focusTint : styles.unFocusTint,
]}
source={require(`../assets/Icons/home.png`)}
></Image>
So I want to create a function that return different images rather than home image only.
So I create a func like this
function something(icon){
<Image
style={[styles.iconArea,
focused ? styles.focusTint : styles.unFocusTint,
]}
source={require(`../assets/Icons/${icon}.png`)}
></Image>
}
something("cart")
This thing is whenever I tried to run its giving me syntax error with this message
What am I doing wrong