LoginSignup
0
0

More than 1 year has passed since last update.

Kotlin/JS ReactNode型に文字列以外入れたい

Last updated at Posted at 2021-11-22

ちょっとハマってしまったのでメモ

これだとエラー

OutlinedInput {
  attrs {
    id = "savecode-adornment"
    label = ReactNode("セーブコード")
    multiline = true
    endAdornment /*:ReactNode?*/ = InputAdornment { //Error!!!!
        attrs.position = "end"
        IconButton {
          CopyAll()
        }
    }
  }
}

createElementで囲むとOK

createElement {
  //いれる
}

OutlinedInput {
  attrs {
    id = "savecode-adornment"
    label = ReactNode("セーブコード")
    multiline = true
    endAdornment = createElement {
      InputAdornment {
        attrs.position = "end"
        IconButton {
          CopyAll()
        }
      }
    }
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0