Cannot access 'withDecaySpring' before initialization
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.
I have the same problem
"expo": "^51.0.31", "react-native": "0.74.5", "react-native-awesome-gallery": "^0.4.2",
Moving the exports.withDecaySpring = withDecaySpring to the bottom of the file solved this issue
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.
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