How do you render the right side of navigation drawer condtionally based on some states or something?

I want to show loading indicator in the right side of navigation bar with ex navigation. If some value is true, show the indicator component in the right side of the navigation bar, and if the value is false, showing null.

P.S - I am not using Redux or any state management libraries.