Open GabrielLasso opened 8 months ago
I changed the main function to
fun main() {
renderComposable(rootElementId = "root") {
val holder: PreComposeWindowHolder = remember { PreComposeWindowHolder() }
CompositionLocalProvider(LocalLifecycleOwner provides holder,
LocalStateHolder provides holder.stateHolder,
LocalBackDispatcherOwner provides holder) {
Body()
}
}
}
And it worked.
It would be nice to have a built in function to this
navigation won't work, but at least view model works :)
Currently PreCompose does not have something like hash router, I'm working on it.
It would be nice of we can use Precompose with Compose HTML.
You can use this template to try it out: https://github.com/JetBrains/compose-multiplatform-html-library-template
I changed the main.kt to:
And added this to build.gradle.kts:
But when I run I get "No StateHolder provided" error... I know that I should change the
renderComposable
call for something, but I didnt found anything for HTML in the documentation