React Native Gesture Handler Swipeable: Data Couldn't Be Read Because It Isn't In The Correct Format

#1

Hey everyone,

I would like to use the new Swipeable module that Brent wrote about in the Expo 22 release. That being said, I’m a bit confused on how to get started.

I know react-native-gesture-handler is under the DangerZone, eg:

import { DangerZone } from expo

DangerZone.GestureHandler doesn’t have Swipeable under the API.

expo/native-component-list has this line:
import Swipeable from 'react-native-gesture-handler/Swipeable'

but that didn’t work either.

Any help would be appreciated!

Thanks!

0 Likes

#3

Copying https://github.com/expo/native-component-list/blob/8ece68e1d3bdef345b8639446a9323172d82433e/screens/GestureHandlerSwipeableScreen.js and importing (will also try replacing modules with ones from expo)

0 Likes

#4

After breaking apart GmailSwipeableRow, I’ve noticed that renderLeftActions, renderRightActions are the culprit to that error message. As soon as you remove them things work. I made renderRightAction return and it still error’d out.

0 Likes

#5

It looks like this was fixed in 1.0.0-alpha.29:
https://github.com/kmagiera/react-native-gesture-handler/commit/6f8d12b8fdc6dc89c823d4812b5142aea9a67fcb

I’m going to try and copy over the file directly from the project and get it working!

0 Likes

#6

Also, since we’re on the topic:

Is there any significance using DangerZone API over just importing the module directly like its happening here:

Is the DangerZone Api more of a “it’s not our fault if it breaks” thing?

0 Likes

#7

re: DangerZone.

It means two things: (1) This is new and less stable (similar to beta in that way) but also, importantly, (2) this may be removed from Expo without much warning, so be aware of that.

Thanks for sharing your investigation into it!

0 Likes

#8

Would you think I’m crazy if I said the error only occurs when Chrome debugger is enabled? Everything works fine otherwise.

0 Likes

#9

I’ve got it working in production:

0 Likes

#10

Hey,

Thanks! I have it working in prod but not when chrome dev tools is open unfortunately.

See these docs:

0 Likes