hey guys.. is it correct to create a “previewTheme...
# compose
v
hey guys.. is it correct to create a “previewTheme” to avoid unnecessary providers when previewing composables?
I have one provider for current user and it does not work in preview, ’cause my user is in local storage.
j
If it's just one, you should easily be able to create a dummy user object that conforms to the same
User
interface, and pass it to the provider at the top of your preview function. The preview function is highlighting the fact that the widget depends on current user, so any engineer who wants to understand that widget will now know they need a user to be in scope.
v
thanks!