function NavigationItem(props){
return(
<TouchableOpacity
onPress={(view)=>props.navigation.closeDrawer()}>
<Text style={customStyle.headerStyle}>{props.titleValue}</Text>
<View style={customStyle.dividerStyle} />
</TouchableOpacity>
)
}
In the above function, you can see that I am receiving data in single argument props and other an object which is passing below. But I don't know why it's working I am passing two values one is props and the other is object titlevalue in the given below syntax. I hope you understand my query I am new in react native.
<NavigationItem {...props} titleValue={"Profile"} ></NavigationItem>