headerRight is same as headerLeft but you are not returning anything from the function that you have provided for headerRight
Change
headerRight: () => {
<View style={{height: 10, width: 10, backgroundColor: 'red'}}>
{/* <Icon name="location-on" size={24} /> */} //headerRight doesn't work
</View>;
},
To
headerRight: () => (
<View style={{height: 10, width: 10, backgroundColor: 'red'}}>
{/* <Icon name="location-on" size={24} /> */} //headerRight doesn't work
</View>;
),
Or
headerRight: () => {
return (<View style={{height: 10, width: 10, backgroundColor: 'red'}}>
{/* <Icon name="location-on" size={24} /> */} //headerRight doesn't work
</View>);
},
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…