Skip to content
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

The library doesn't work in web #117

Open
Pavel-Ilyin opened this issue Jan 3, 2025 · 0 comments
Open

The library doesn't work in web #117

Pavel-Ilyin opened this issue Jan 3, 2025 · 0 comments

Comments

@Pavel-Ilyin
Copy link

I downloaded the library to my commonMain block:

commonMain.dependencies {
...
  implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03")
...
}

Then inserted the example code in my app:

@Composable
fun MainMenuScreenView() {

  ConstraintLayout {
    // Create references for the composables to constrain
    val (button, text) = createRefs()

    Button(
      onClick = { /* Do something */ },
      // Assign reference "button" to the Button composable
      // and constrain it to the top of the ConstraintLayout
      modifier = Modifier.constrainAs(button) {
        top.linkTo(parent.top, margin = 16.dp)
      }
    ) {
      Text("Button")
    }

    // Assign reference "text" to the Text composable
    // and constrain it to the bottom of the Button composable
    Text(
      "Text",
      Modifier.constrainAs(text) {
        top.linkTo(button.bottom, margin = 16.dp)
      }
    )
  }
}

And, finally, I deployed my app to the server and then run it in browser.
Not a single view was drawn. Instead of it I got errors in console:
image

I get this error even if I put only empty ConstraintLayout {} to my view.
Is there something I did wrong, or it's a problem of library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant