In my @Preview function I reference a composable function which sits in another kt file. This gives me render problems. When I move same composable function in the file where @Preview function is defined, it works. The stack trace doesn't really help me to figure out the reason, why this happens. Can someone have a look please.I'm on beta05 and Canary 14.
I’d start by filing a bug, with repro code if possible.
1 year ago
What I can say is that the component per se is not the problem. It seems that the surrounding code has an effect on the Preview because moving the component that has to be previewed into an empty kt file makes it work. In the case above it was stored in a file that has also non-compose code inside.So tl;dr: It seems that @Preview can't handle components that are located in files with mixed code (compose + non-compose. Do you think I should still file a bug?
Zach Klippenstein (he/him) [MOD]
1 year ago
Absolutely. Even if that was not intended to work (and I can’t imagine that’s the case), this would be a bad ux