Stops recomposing the drawer at every new route.
This commit is contained in:
@@ -407,11 +407,8 @@ fun NavigationRow(
|
|||||||
route: String
|
route: String
|
||||||
) {
|
) {
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
val currentRoute = currentRoute(navController)
|
|
||||||
IconRow(title, icon, tint, onClick = {
|
IconRow(title, icon, tint, onClick = {
|
||||||
if (currentRoute != route) {
|
navController.navigate(route)
|
||||||
navController.navigate(route)
|
|
||||||
}
|
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
scaffoldState.drawerState.close()
|
scaffoldState.drawerState.close()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user