How to determine current screen's path?

I have a drawer with a reusable component. Nothing fancy; just a bunch of navigation links within the app and sign-out, settings, etc.. If a navigation link is the "current" screen, I want to just "close the drawer". Otherwise, navigate to the screen. But I cannot find a way to dynamically determine what the current screen which the drawer is opened from.

Any advice? Thanks!

2