Is there a way to create a child with predefined p...
# react
b
Is there a way to create a child with predefined properties, which I can then override? Like so
Copy code
child(Button::class.rClass, buttonProps) {
    attrs {
        onClick = this@ButtonGroup::buttonClicked
        active = index in state.activeButtons
     }
}
This one fails because every property of
buttonProps
is readOnly
I fixed it by making
buttonProps
immutable:
Copy code
val immutableButtonProps: Button.Props = Object.assign(jsObject(), buttonProps)
s
may be you can have a HOF which sets the props.