어플을 만들다 보면 헤더 부분에 버튼이나, 글을 넣어야 할때가 있을수 있다.
class Header_button extends Component {
//react hooks를 사용할수 있음
componentDidMount() {
this.props.navigation.setOptions({
headerRight: () => (
<Button
onPress={() => {
return alert('게시글이 등록 되었습니다.');
}}
title="글등록"
/>
),
});
}
render() {
return (
<View>
<Text>기다려주세요</Text>
</View>
);
}
}