Hilt는 해당 Android 클래스의 수명 주기에 따라 생성된 구성요소 클래스의 인스턴스를 자동으로 만들고 제거합니다.

생성된 구성요소 생성 위치 소멸 위치
SingletonComponent Application#onCreate() Application 소멸됨
ActivityRetainedComponent Activity#onCreate() Activity#onDestroy()
ViewModelComponent ViewModel 생성됨 ViewModel 소멸됨
ActivityComponent Activity#onCreate() Activity#onDestroy()
FragmentComponent Fragment#onAttach() Fragment#onDestroy()
ViewComponent View#super() View 소멸됨
ViewWithFragmentComponent View#super() View 소멸됨
ServiceComponent Service#onCreate() Service#onDestroy()