New JSX-like syntax?

I saw the following class definition in the Jetpack Compose sources:

@Composable
inline fun Clip(shape: Shape, crossinline children: @Composable() () -> Unit) {
    <RepaintBoundaryNode name=null shape=shape clipToShape=true>
        children()
    </RepaintBoundaryNode>
}

What is this new syntax exactly and why is it required (instead of a better and “known” builder pattern)?

I found the answer and I’m happy with it :slight_smile:

You may also see some references to an XML-like syntax (known internally as KTX) which is our old syntax from before the method interception was a thing. We are transitioning from the KTX syntax to using a Kotlin DSL based on intercepted function calls.

:ok_hand:

1 Like