react-native-awesome-gallery icon indicating copy to clipboard operation
react-native-awesome-gallery copied to clipboard

Cannot access 'withDecaySpring' before initialization

Open shamxeed opened this issue 1 year ago • 4 comments

Thanks to this amazing and indeed awesome lib. But please I am having an issue with this lib on the Web. everything works as expected on mobile but not on the web.

Screenshot (19)

shamxeed avatar Sep 09 '24 23:09 shamxeed

I have the same problem

"expo": "^51.0.31", "react-native": "0.74.5", "react-native-awesome-gallery": "^0.4.2",

image

abramovks avatar Sep 30 '24 02:09 abramovks

Moving the exports.withDecaySpring = withDecaySpring to the bottom of the file solved this issue

anhkieet avatar Dec 13 '24 04:12 anhkieet

Moving the exports.withDecaySpring = withDecaySpring to the bottom of the file solved this issue

Had the same issue, fixed it for me as well. Would be a quick PR for anyone.

For easy reference, the file in question is the one located at [your app root]/node_modules/react-native-awesome-gallery/lib/commonjs/utils/withDecaySpring.js

The line in question is line # 6 and like @anhkieet said, it works when it's cut/pasted at the bottom, so after the withDecaySpring function definition.

SirTwinkleberry avatar Dec 18 '24 21:12 SirTwinkleberry

Here's the fixed version that also includes @markstreich's Web compatibility PR: https://github.com/TmLev/react-native-awesome-gallery/tree/web

Installation with pnpm:

pnpm add react-native-awesome-gallery@github:TmLev/react-native-awesome-gallery#web

TmLev avatar Oct 15 '25 13:10 TmLev