Closed cgorrieri closed 1 year ago
It’s possible it’s because your image starts with https…this might have been an incorrect implementation on my end, I figured that’d only be used for unoptimized URLs. Not positive that’s it, but it might be.
If I put the loader directly on the SolitoImage component, I get as expected the image returned by the loader. So it seems that the context is not used properly by the SolitoImage or there is something I am missing.
Hm, that’s weird. Do you have multiple versions of Solito installed?
I just ran yarn list solito
and I have only one.
It looks like in https://github.com/nandorojo/solito/blob/master/src/image/use-solito-image.ts#L77 it is using the loader passed to it, and in there https://github.com/nandorojo/solito/blob/master/src/image/fast/fast.tsx#L11 the loader passed to it is the one from the props. Nowhere it is checking for the one in the context.
Can you try Solito 2.1.1? I think I just released a fix.
Yes! It is working now. Thank you :)
Actual
Custom
SolitoImageProvider
loader is not being used bySolitoImage
components down the App.Expected
The custom loader is used.
Versions
How to reproduce
Follow the steps at https://solito.dev/tailwind and install the dependencies for
solito/image
as mentioned in https://solito.dev/usage/image#expoIn
apps/expo/App.tsx
:in
packages/app/features/home/screen.tsx
:When running
npx expo run:ios
(or android) I see the image provided to the SolitoImage and not the one that is returned by the loader nor the log from theconsole.log
.If I put the loader directly on the
SolitoImage
component, I get as expected the image returned by the loader. So it seems that the context is not used properly by theSolitoImage
or there is something I am missing.