https://kotlinlang.org logo
#decompose
Title
# decompose
p

Phil Saul

08/28/2022, 12:26 PM
Hi, is it possible to use the WebHistoryController with nested navigation? We have an application that has a number of child components each with their own child stacks and would like to be able to navigate to /a/x or /a/y etc in our Kotlin/JS app.
a

Arkadii Ivanov

08/28/2022, 2:05 PM
Hello. At the moment
WebHistoryController
does not support nesting. It is not clear how nesting could be aligned with the Web History API, which is just a linear forward-backward navigation. But thanks for raising, I will think about it. There is an open issue for this - https://github.com/arkivanov/Decompose/issues/111 As an idea, you can try to create a separate fake
ChildStack
in your parent component, and then attach
WebHistoryController
to it. After that, all you need to do is to listen for both the parent's and children's stack changes and reflect everything in the fake stack in a way that works for you.
5 Views