New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CompositionLocal LocalDensity not present #204
Comments
When I removed the |
However, when I move it out of the HashRouter, it does not works, too. But, if I call it directly in the The fun main() {
renderComposableInBody {
Text("TEST!")
WebRouter()
}
} works, but below not: @Composable
fun WebRouter() {
Text("Test")
HashRouter().route("/") {
Routing()
}
} |
Hey, could you provide a reproducer? I tried your first code: @Composable
fun WebRouter() {
HashRouter("/") {
route("/") {
Text("Hello World")
}
}
}
fun main() {
renderComposable(rootElementId = "root") {
Text("as")
WebRouter()
}
} and it works fine. |
Yeah, I will later. Thanks. |
@hfhbd I found the problem! It is caused by the Material 3. This problem causes when using Add @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
api(compose.material3) then import androidx.compose.material3.Text. I think this is a problem of compose. |
Okay, so is it reproducible without routing? Otherwise could you still upload your reproducer to analyze the integration with routing? |
emmm good problem, testing |
Ok, I tested. It is JetBrains' job. Really thanks. |
Moved to JetBrains/compose-multiplatform#2186. |
When I was using this library in a Web project, I got this error:
CompositionLocal LocalDensity not present
.Code:
The exception threw in the
Text
in the router, theText
outside does not throw any exception.Why is it happening? Thanks.
The text was updated successfully, but these errors were encountered: