How to change mechanism of listener like launchedeffect with compose function within?

45 views Asked by At

I need to change swipeStates when list param is changed, but rememberSwipeableCardState is composable function so I cannot do it I receive an error:

@Composable invocations can only happen from the context of a @Composable function
    LaunchedEffect(list) {
        if (list != null) {
            swipeStates = list.map { it to rememberSwipeableCardState() }
        }
    }

How to create such workaround for this mechanism?

0

There are 0 answers