Library works in Snack but not in Expo SDK

Hi there,

I did some code in a snack (link I will provide now) with a library called react-native-swipe-list-view. This works nicely in Snack, but, the main problem occurs when I copy and paste this code into my app. It totally crashes with a red screen.
I have being implementing little by little and the error is the SwipeRow component of that library.

I still cannot understand why this is happening…
Snack link: React Native Swipe List View - Snack
Github Issue to the library: Expo does not work with this · Issue #293 · jemise111/react-native-swipe-list-view · GitHub

@charliecruzan @adamjnav or anyone, can you please bring some light to this issue?

Thank you very much :slight_smile:

I have tried to look at withExpoRoot.js:21, and I found this class:

So in line 21 it calls RootErrorBoundary that comes from the same folder RootErrorBoundary, and I see a huge class:

I cannot go on more than this far because I cannot find any more of the references the error gives me and I am nuts right now.

@charliecruzan @adamjnav (you answered me in other topics that’s why I mention you, sorry)

PD: Both files are located in: "C:\Users\node_modules\expo\build\launch"

Hi @guardme,

Is there a particular reason you’ve chosen this library rather than react-native-gesture-handler? That’s usually the one we recommend.

I’m not sure why this would work correctly in Snack, but not in an Expo project though. You may have to read through the docs a little more thoroughly- I believe <SwipeRow/> is generally used in a <SwipeListView/>

No, actually I didn’t knew about react-native-gesture-handler I will try to look into it, but anyway, the error is so strange, because I cannot find any reason why that Snack works and in my Expo project it does not. Can I use it with an standalone app? Because Expo documentation talks only about managed apps, which is not my case.

<SwipeRow /> can be used by itself, proof of that is that Snack which is an adaptation of the Snack the author of react-native-swipe-list-view did.

I had this problem also with another library for swiping call react-native-swipeout, whenever I an element of that library (eventhough it works also in Snack) it does not work…

I hope you could give me a solution.

I came to the conclusion that there is some kind of problem with an expo dependencie, because this problem also arraised whenever I use a component and I don’t remember to import it. Hope that help to figure out the problem.

The component does not have anything weird and it can be look at this github repository, it uses only react, react-native, and proptypes (react-native-swipe-list-view/SwipeRow.js at master · jemise111/react-native-swipe-list-view · GitHub).
By the way, I have also tried, unsucessfully, to make my own component with the same code pasted just in case there was some problem in the installation.


We’re looking into why this would be different in Snack as opposed to trying to serve through the CLI. One difference is that Snack always runs in production- so it’s possible this error only surfaces in development :thinking:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.