What's the use case of `PropsWithChildren`? Will t...
# react
p
What's the use case of
PropsWithChildren
? Will the element(s) added there be automaticaly rendered? And what the difference with
ReactNode.unaryPlus()
in
RBuilder
?
t
With
PropsWithChildren
you can mark components, which use
props.children
Future plan - allow child extensions for components, which use
PropsWithChildren
and disable for others
Copy code
val Button = fc<Props>()

// ...

Button {
    div() // ERROR
}
👍🏻 1
👍 2