Skip to content

Commit

Permalink
- Stop recomposing QuotesListScreen twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashank02051997 committed Jul 28, 2021
1 parent 364e808 commit 6be1eab
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ fun NavGraph(toggleTheme: () -> Unit) {
NavHost(navController, startDestination = Screen.Home.route) {
// Quotes List
composable(Screen.Home.route) {
val viewModel: MainViewModel = viewModel(
factory = HiltViewModelFactory(LocalContext.current, it)
)
val viewModel = hiltViewModel<MainViewModel>(it)
QuotesListScreen(viewModel, toggleTheme, actions)
}

Expand Down

0 comments on commit 6be1eab

Please sign in to comment.