Logout in drawer navigator

Currently, I have this button that is used to log out of my application. I would like to remove this button and have it appear in the dropdown menu instead. For it to appear in the dropdown menu, I need to create a screen. I was thinking of adding a screen and then, in the code for that screen, adding my current code under ‘when screen opens’, so there wouldn’t really be a page, just a redirection. It’s my somewhat indirect way of accomplishing the task—what do you think?