Apologies - can anyone explain what I need to do to fix this message:
Functions which invoke @Composable functions must be marked with the @Composable annotation
- I can't mark
main
as composable; I tried moving the body of my application into a separate @Composable function, but I feel like I'm missing some key understanding here.
c
Casey Brooks
04/19/2021, 7:11 PM
Compose for Desktop runs inside the normal Java Swing system, currently. the
main
function is literally just the standard entry-point to a JVM application, and there’s nothing specific about it that makes it Composable. You have to bootstrap the Swing/Compose toolkit yourself with the
Doh! But's remarkable how much code you can write - and have work - without doing this... I've been playing with this for days with my call to `Window()`about 40 lines into the main function!
c
Chris Sinco [G]
04/20/2021, 4:08 AM
My general debugging process on this is to look up the hierarchy to see if I’m calling something in a non-Composable context. Though I don’t blame you because sometimes it’s not obvious and requires trial-and-error.