react-native-draggable-flatlist
react-native-draggable-flatlist copied to clipboard
scroll handler issue
I'm using expo cli and it's a web version, I get a crush and the app cannot run.
on a black app copy the code example from documentation and run on web.
Platform & Dependencies
- react-native-draggable-flatlist latest version:
- Platform: web
- React Native or Expo version: "expo": "~45.0.0",
- Reanimated version:"react-native-reanimated": "^3.3.0",
- React Native Gesture Handler version: "react-native-gesture-handler": "^2.12.0",
Additional context looks like an error happening in the scroll handler.
console:
./node_modules/react-native-reanimated/lib/module/reanimated2/js-reanimated/index.js Module not found: Error: Can't resolve 'react-native-web/dist/exports/StyleSheet/compiler/createReactDOMStyle' in 'C:\Users\kobi.shunak\Desktop\Dex\DexNative\DEX\node_modules\react-native-reanimated\lib\module\reanimated2\js-reanimated' ./node_modules/react-native-reanimated/lib/module/reanimated2/js-reanimated/index.js Module not found: Error: Can't resolve 'react-native-web/dist/exports/StyleSheet/preprocess' in 'C:\Users\kobi.shunak\Desktop\Dex\DexNative\DEX\node_modules\react-native-reanimated\lib\module\reanimated2\js-reanimated'
developer tools:
utils.ts:83 Uncaught TypeError: Cannot read properties of undefined (reading 'toString')
at utils.ts:83:1
at Array.reduce (
at DraggableFlatListInner (http://localhost:19006/static/js/bundle.js:210030:86)
at RefProvider (http://localhost:19006/static/js/bundle.js:211234:23)
at AnimatedValueProvider (http://localhost:19006/static/js/bundle.js:210883:23)
at PropsProvider (http://localhost:19006/static/js/bundle.js:211186:23)
at DraggableFlatList
at App (http://localhost:19006/static/js/bundle.js:292700:73)
at RoutesProvider (http://localhost:19006/static/js/bundle.js:23830:77)
at SettingsProvider (http://localhost:19006/static/js/bundle.js:24263:77)
at AuthProvider (http://localhost:19006/static/js/bundle.js:23255:77)
at $704cf1d3b684cc5c$export$9f8ac96af4b1b2ae (http://localhost:19006/static/js/bundle.js:46605:69)
at ToastProvider (http://localhost:19006/static/js/bundle.js:147739:24)
at PortalProvider (http://localhost:19006/static/js/bundle.js:50521:70)
at HybridProvider (http://localhost:19006/static/js/bundle.js:156046:23)
at ResponsiveQueryProvider (http://localhost:19006/static/js/bundle.js:174851:13)
at div
at http://localhost:19006/static/js/bundle.js:271201:25
at NativeSafeAreaProvider (http://localhost:19006/static/js/bundle.js:261605:23)
at SafeAreaProvider (http://localhost:19006/static/js/bundle.js:261802:23)
at Provider (http://localhost:19006/static/js/bundle.js:174301:26)
at NativeBaseProvider (http://localhost:19006/static/js/bundle.js:155757:32)
at App
at ExpoRootComponent (http://localhost:19006/static/js/bundle.js:78110:83)
at div
at http://localhost:19006/static/js/bundle.js:271201:25
at div
at http://localhost:19006/static/js/bundle.js:271201:25
at AppContainer (http://localhost:19006/static/js/bundle.js:263061:24)
See https://github.com/software-mansion/react-native-reanimated/issues/2994#issuecomment-1211247103
Add to babel
const compileNodeModules = [
// Add every react-native package that needs compiling
'react-native-draggable-flatlist',
...
and
use: [
{
loader: 'babel-loader',
options: {
plugins: ['react-native-web', 'react-native-reanimated/plugin'],
},