Replies: 1 comment
-
The tabnavigator has its own navigator. So put all your HomeScreenModel things just before the HomeScreenContent |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi :) hope you are doing well.
A few moments ago I just implemented navigation with Tabs.
HomeScreen as the main container and other 4 tabs.
I want to share data between screens but Tabs are objects so I can not share data through the constructor, so I tried with ScreenModel but it only works on the HomeScreen
`
class HomeScreen(private val provider: DependencyProvider) : Screen {
@OptIn(ExperimentalVoyagerApi::class)
@composable
override fun Content() {
}
`
If I try to use the HomeScreenModel instance in other Tab, app crashes because I am not using the same instance
`
object OrdersScreen : Tab {
}
`
Not sure If it is a bug or I am not using the library properly.
Can you help me? please
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions