Create a bidirectional repeating/looping infinite scrollView in react native - react-native

I want to create a scroll that repeats itself, again and again, i.e. when I keep scrolling to the top I reach the last row and when I scroll to the bottom I reach the first row again.
I have tried searching components for the same, but the best I could find were these -
react-native-infinite-scroll and this stackoverflow answer but both of them only tell about how can I load more data when I reach the ScrollView or ListView end.

I searched a lot for this type component but couldn't find any, so I created my own component from scratch using FlatList, and also published it to npm, so anyone can install it using
npm install react-native-infinite-looping-scroll
in your react native project directory.
The component is still in beta so don't expect very good performance from it. But the component is still pretty basic and there's a lot of scope for improvement so anyone who wants to contribute to it can submit a PR here.

Related

React native Flat list optimization

I am trying to build a contact list in react native. I don't do all the possible optimization that are mentioned in the following mentioned places.
React native flat list optimization
8 ways to optimize React native FlatList performance
how-to-optimize-your-react-native-flatlist
How did I optimize my React Native FlatList?
flatlist-performance-tips
react-native-optimized-flatlist
I have tried all these one by one. by flat list is too much smooth now. but the only problem is that it takes some time to load initially. I want it like the contact book how has no loading. her ei ma attaching video link how it is behaving.
my own flat list source code
Video
** anyone who can help me to resolve this. I am tired of this and now this becomes a headache for me. help will be really appreciated. ia m trying on this for one month but invain.**
Take a look at the docs specifically about the attributes maxToRenderPerBatch,updateCellsBatchingPeriod and removeClippedSubviews. In your case, it's rendering 50 items per batch of render, the updateCellsBatchingPeriod maybe is making the list update itself longer than expected and maybe if you set the prop removeClippedSubviews to true the list is going to stay fluid as you want.

React native turn by turn navigation

we working with expo and using mapview, however, there are many restrictions in react native maps, as we are planning to implement turn by turn navigation. Integrating Mapbox would have been the best option, however we do not think it’s best to eject the project as expo doesn’t still support Mapbox. Although, I came across a package, react native maps navigation, I would like to know if anyone has been able to successfully implement it in their project and it functioned properly, and also know if there are any drawbacks that comes along with it. I am asking this because the author says “Please note that this module is usable but still under heavy development. Some properties and/or component names might change without notice.”
Kindly give your suggestions and advice. Thanks
Mapbox works very well in a react-native projects and recommend to use this service for your project but effectively, it don't works with expo so for me, you should eject your project to use it.
I paste here some packages I used for a GPS project (The last one is to get the current position of an user)
react-native-mapbox-gl/maps
mapbox-sdk
react-native-geolocation
Hope that could help you

Hot reloading doesn't work on a react-native app with react-router-native and redux

I'm starting with react native and I have a little experience with React, Because of that I want to use redux, react-router, and react-router-redux, which I have used in the past for a web React app.
All those packages can be used in react-native, except for react-router, the closest I could find is react-router-native which seems to work much like the browser version. So far so good, I made a quick and dirty app to test the router, redux, etc.
But I'm having some issues I can't figure out how to solve or debug: When changing the visuals like the text or some styles, the HMR seems to work fine, applying the changes in real time, but when I change some other module/file, like the container element (where the redux connect() function is called) or some code on the reducers, the HMR doesn't change anything and I have to reload all the app to see the changes.
Here is my code: https://github.com/DenJohX/test-react-router-native It basically just changes the color of some text by toggling a variable in the redux store. Sorry for just linking it but I think its better to show you all the folders and project structure, maybe I'd just goofed something in there or didn't use the correct folder structure.
I'm using https://github.com/jhen0409/react-native-debugger to debug the app, and by the console messages, the HMR does run and patches something but without affecting the current loaded code.
To test the problem, try to edit the colors in src/screens/pageOneContainer.js, the HMR should change the code, re-render the screen, and show the new colors, but they just stays the same.
Thanks in advance.

react-native-router-flux - Resetting navigation stack in tab

What we want
We use react-native-router-flux in our application and find ourself in a situation where we need to reset the navigation stack (at least) for one tab. This is our scene structure:
tabs
listTab
listView
recordingView
creationTab
recordView
descriptionView
publishView
Concretely, our application lets users create and view recordings. There's a listTab, with two sub-scenes (list of recordings and view a single recording) and a tab for creating (creationTab) recordings with several steps (recordView, descriptionView, publishView). After the last step, the recording is published and we redirect to the viewRecording scene for that recording in the listTab.
When pressing the creationTab again, we would like to get back to the first scene of the creation process again, but instead we of course land on the last step (publishView) again.
What we tried
After reading through the documentation and issues connected to this, we figured the option reset might help us. However, if we try to add type='reset' to the props of creationTab, when pressing the tab, all other tab icons disappear (as documented in this issue).
So instead, we then tried to set the type of our push from publishView to recordingView to reset, but that also did not work (although the right action is dispatched and the back button is removed on the new scene, when hitting the recordingTab icon again, we still get back to our old publishView).
We also though about using Switches, to unmount the components but it doesn't seem like this is how they were intended to be used...
Versions
react-native: 0.30.0
react-native-router-flux: 3.32.0
We're now getting a bit desperate after days spent on issues like this and similar ones and I am not sure how we should proceed. Has anybody experienced similar problems or found a solution?
I faced the same issue. As a temporary workaround, I do not use the reset option but instead follow the redirection immediately with a pop action.
In my case, my view is only one level deep so this is not too dirty. I'll look for a cleaner solution but I hope it can help in the meantime.
react-native: 0.35.0-rc
react-native-router-flux: 3.35.0

How to delete a ListItem by Swiping out the element?

I am trying to find a Component how to remove my ListItems in my ListView. Actually there is a Module working for iOS react-native-swipeout where you can swipeout the elements. I need the same for Android or atleast something similar.
Maybe someone has figured this out, and could tell me how they solved deleting Items from a ListView in a React Native Android App
The react native team removed their experimental implementation for the SwipeableFlatList component (which uses internally a FlatList instead really really deprecated ListView).
I rescued the original code from v0.59 which they removed on v.60 and its available as a npm module here
And theres a good how-to on medium here