Hi everybody.
I am in the process of migrating my application. For the own functional components this is (so far ;)) no problem. However, I also use external components where I currently don't know how to migrate them easily. Does anyone have an example or a tip for this?
Copy code
@JsName("default")
external object ButtonComponent : Component<ButtonProps, ButtonState> {
val Group: ButtonGroupComponent
override fun render(): ReactElement? // Has to be ReactNode
}
fun RBuilder.aButton(handler: RHandler<ButtonProps>) = child(ButtonComponent::class, handler)
✅ 1
b
Big Chungus
03/14/2022, 3:10 PM
For external class-components one should use RClass instead (at least that's how it was a year ago). i.e.
Copy code
external val ButtonComponent: RClass<ButtonProps, ButtonState>
//OR
external class ButtonComponent: RClass<ButtonProps, ButtonState>
d
Dirk
03/14/2022, 3:16 PM
I believe RClass no longer exists in the "new" React wrapper? At least IntelliJ does not find this class.
t
turansky
03/14/2022, 3:17 PM
Copy code
external val Button: ComponentClass<ButtonProps>
turansky
03/14/2022, 3:18 PM
Type names were synchronized with TS definitions
d
Dirk
03/14/2022, 3:46 PM
Thank you very much! I couldn't test it in the big project because of the size, but it worked in a new test project.