Added optional custom navKeyFunction for late router dependency