//common
expect class PlatformElement
//android
//works
actual typealias PlatformElement = View
//js
//error:The following declaration is incompatible because modality is different
actual typealias PlatformElement = HTMLElement
I found HTMLElement is
abstract
, so it fails. But I won't use the constrcutor, I just want to declare the type, so what should I do ?
j
jw
07/03/2023, 2:11 PM
as long as you don't expose a constructor in common you can suppress the error and it'll be fine.
another option is to use a value class on JS to "wrap" HTMLElement