Understanding the inner workings of react-navigation to create a custom navigator