Skip to content

Instantly share code, notes, and snippets.

@frhack
Last active March 21, 2023 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frhack/f4c8d16b122c27acafd7afaf3cc97718 to your computer and use it in GitHub Desktop.
Save frhack/f4c8d16b122c27acafd7afaf3cc97718 to your computer and use it in GitHub Desktop.
custom react hook form in kotlin
FormControl {
sx {
minWidth = 200.px
//this@FormControl.size = Size.small
}
Controller {
name = "fook"
control = hf.control
render = { x: dynamic ->
Fragment.create() {
Select {
//sx {
// minWidth = 100.px
// this@FormControl.size = Size.small
//}
//defaultValue = "email"
name = "OOO"
id = "demo"
console.log(tipo)
value = tipo.unsafeCast<Nothing?>()
//MenuProps
onChange = { p, _ ->
console.log(p.target.value)
tipo = p.target.value
}
//input {
//OutlinedInput { label = ReactNode("name") }
//}
MenuItem {
key = "email"
value = "email"
+"email"
}
MenuItem {
value = "phone"
key = "phone"
+"phone"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment