I'm trying to use a `UIKitViewController` with fre...
# multiplatform
d
I'm trying to use a
UIKitViewController
with frequently changing animation state, but it seems to never rebuild. See thread.
This is my code:
Copy code
@Composable
actual fun NativeAppTopBar(
    modifier: Modifier,
    pagerState: PagerState
) {
    val coroutineScope = rememberCoroutineScope()
    val factory = LocalNativeViewFactory.current
    val appTabs = AppTabs.entries.map { it.label.asString() }

    UIKitViewController(
        modifier = modifier.statusBarsPadding(),
        factory = {
            println("rebuilt")
            factory.createAppTopBarView(
                currentOffsetForPage = { pagerState.calculateCurrentOffsetForPage(it) },
                onClick = { coroutineScope.launch { pagerState.animateScrollToPage(it) } },
                appTabs = appTabs
            )
        }
    )
}
PagerState current offset changes very frequently, yet the View never rebuilds after the initial build.