doesn't support @Composables with default params
See original GitHub issueHopefully this is enough of a stacktrace with beta12:
error: com.airbnb.android.showkase.processor.exceptions.ShowkaseProcessorException: Make sure that the @Composable functions that you annotate with the Preview annotation only have a single parameter that is annotated with @PreviewParameter.
at com.airbnb.android.showkase.processor.logging.ShowkaseValidator.validateComponentElement$showkase_processor(ShowkaseValidator.kt:59)
Supported source version 'RELEASE_8' from annotation processor 'org.jetbrains.kotlin.kapt3.base.ProcessorWrapper' less than -source '11'
at com.airbnb.android.showkase.processor.ShowkaseProcessor.processPreviewAnnotation(ShowkaseProcessor.kt:101)
at com.airbnb.android.showkase.processor.ShowkaseProcessor.processComponentAnnotation(ShowkaseProcessor.kt:75)
com.airbnb.android.showkase.processor.exceptions.ShowkaseProcessorException: Make sure that the @Composable functions that you annotate with the Preview annotation only have a single parameter that is annotated with @PreviewParameter.
at com.airbnb.android.showkase.processor.ShowkaseProcessor.process(ShowkaseProcessor.kt:57)
at com.airbnb.android.showkase.processor.BaseProcessor.internalProcess(BaseProcessor.kt:96)
at com.airbnb.android.showkase.processor.BaseProcessor.process(BaseProcessor.kt:64)
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top Results From Across the Web
Composable functions with non-default parameters are not ...
As the issue defines here Composable functions with non-default parameters are not supported. This means that there should be a default ...
Read more >Support default values in @Composable abstract functions ...
Adding default values to a @Composable function in an interface/abstract class results in 'Abstract Composable functions cannot have parameters ...
Read more >Locally scoped data with CompositionLocal | Jetpack Compose
Not providing a default value can cause problems and frustration when creating tests or previewing a composable that uses that CompositionLocal will always ......
Read more >First steps in Jetpack Compose, Part 1 - ProAndroidDev
Composable functions with non-default parameters are not supported in Preview unless they are annotated with @PreviewParameter.
Read more >Composable Functions - Medium
Notice that the composable doesn't return anything (it returns `Unit`), ... Notice that the parameters provided to the functions entirely control the UI....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kenyee The stopgap solution would be to just wrap these methods inside a function that doesn’t accept parameters. Definitely not ideal but unblocks you…
As I think more about it, I think it should be straightforward to add this functionality (support for functions with default params). Will keep you posted!
thanks Vinay! That looked like a decent amount of changes 😃