alexZajac / react-native-skeleton-content

A customizable skeleton-like loading placeholder for react native projects using expo.
https://www.npmjs.com/package/react-native-skeleton-content
MIT License
603 stars 135 forks source link

react-native-reanimated v3 drops support for code this package uses (fixed) #94

Open Ario99 opened 7 months ago

Ario99 commented 7 months ago

Describe the bug react-native-reanimated dropped support for api v1 which this repo depended on. The fix I have provided is a modification of @phanghos's code in their issue for the nonexpo version of this package. I have patched this issue with patch-package for v1.0.28. I used this patch and some resolutions to fix the issue for myself.

Patch

Resolutions

Here is the diff that fixed this problem for me react-native-skeleton-content+1.0.28.patch

To Reproduce You will run into the same problem upon upgrading to a newer version of the expo sdk. I am running this currently on expo sdk 49.

Expected behavior Animations to play where they were previously working.

Smartphone (please complete the following information):

Additional context I understand that this issue may not be fixed with the info I provided for an indefinite period of time. The maintainer is predisposed so in the mean time I hope I have provided the information others may need so they will not have to jump through the same hoops I did. I definitely did learn a lot in the process. If you have any questions, I hope I will be able to answer in a timely matter.

Also it seems if you don't want to mess with patch-package to fix this. You may be able to use this package in the mean time until the pull request for the changes contained within @marcuzgabriel's are made. I'm not for sure if I tried their package previously but it may be more convenient for you than what I have given here.

AnushavanGhulyan-melon commented 7 months ago

This is the updated version. https://github.com/marcuzgabriel/react-native-reanimated-skeleton

Engazan commented 7 months ago

This is the updated version. https://github.com/marcuzgabriel/react-native-reanimated-skeleton

nah, its not for expo, it uses react-native-linear-gradient ... and not expo-linear-gradient ...

marcuzgabriel commented 7 months ago

@Engazan. Isn't it possible to switch out expo-linear-gradient package with react-native-linear-gradient or does expo not support that?

Engazan commented 7 months ago

@Engazan. Isn't it possible to switch out expo-linear-gradient package with react-native-linear-gradient or does expo not support that?

I m not sure but it contains iOS and android folders witch almost always mesn that you need "config plugin" / prebuild (dev client) or eject (almost useless nowdays)

But when i tried it i got errors With can be solved only With "pod install" or config plugin :/

But for this project i cant do that, client doesnt want that

But there is "react-native-shimmer-placeholder" that works fine With expo and it only need minimum changes its almost same kind of, and it has driber option so you can choose what you want use (expo or something else ) witch is great

marcuzgabriel commented 7 months ago

Good you found an alternative šŸ„‡ . I will try have a look on why react-native-linear-gradient won't work with expo and the other way around why expo-linear-gradient won't work with my library.