Björn Lilleike
07/29/2022, 3:48 PMval RecursiveRenderer = FC<ArticyObjectProps> { props ->
Typography {
+"${props.articy.Id} of ${props.articy.Type}"
}
props.articy.Children?.forEach { sub: ArticyObject ->
RecursiveRenderer { articy = sub }
}
}
The compiler error is "Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly".
But what types I could declare more explicitly I have no idea.
I have seen examples in Typescript so this should be possible, but there is no ignore option for this, is there?turansky
07/29/2022, 4:43 PMval RecursiveRenderer : FC<ArticyObjectProps> = FC { ... }
?Björn Lilleike
07/29/2022, 4:48 PMturansky
07/29/2022, 4:49 PMBjörn Lilleike
07/29/2022, 4:52 PMBjörn Lilleike
07/29/2022, 4:56 PMenum class ArticyTypes(val renderer: FC<ArticyObjectProps>) { GENERIC(renderer = RecursiveRenderer); }
within The RecursiveRenderer I can now use:
ArticyTypes.GENERIC.renderer { articy = sub; level = props.level + 1 }
But would be nice to know a simpler working syntax.turansky
07/30/2022, 10:14 PMBjörn Lilleike
08/01/2022, 9:23 AMMikhail
10/25/2023, 4:25 AMval ListItem: FC<ListItemProps> by lazy {
FC {
//...
ListItem {
//...
}
//...
}
}
It works well