Comments (9)
It is not well documented, yes. But it describes where you should fetch docs from. Since FlatList is actually a VirtualizedList: https://facebook.github.io/react-native/docs/virtualizedlist.html#windowsize
from react-native-image-gallery.
Since v2.0.0
, this module relies on FlatList
. This is the only thing that will affect the rendering logic of each image.
For now, I left the optional optimizations of the component blank. I will keep an eye on the performance of galleries with a large number of items and/or big images and see if it's important to either provide these optional props for FlatList
, or at least let the users provide their own if they need to tweak it.
So, to give you an answer, if FlatList
is behaving how react-native describes it, it should render enough images to fill the whole list horizontally, so, only one.
Actually, I'm pretty sure it's not doing that behind the scenes. FlatList
is far from being totally finished and is still riddled with bugs and regressions across versions.
I don't want to over-optimize things yet, but if the need arises we'll release a version that renders items in a more optimized way, especially on the first render.
from react-native-image-gallery.
By default FlatList renders the currently viewed screen + 10 more in any direction. This means you ould normally end up with 21 rendered screens.
from react-native-image-gallery.
@vbuch this is interesting, is this documented anywhere ? Or did you peak at the source code ? FlatList is still shady right now.
from react-native-image-gallery.
So in the case of this image gallery setting windowSize={3}
should be exactly what's needed.
from react-native-image-gallery.
I didn't know about this prop, it might be good to allow users to pass props to FlatList
directly then.
from react-native-image-gallery.
Having it set to 3 by default is a good idea though. In most usecases of the gallery you would only need three. You cannot actually scroll past a couple of images, right?
from react-native-image-gallery.
I agree with @vbuch, preloading 10 images at the startup is causing initial render of the application slower. This is the reason I rolled back to version 1.1.0 and wrote my own logic using Image.prefetch to preload 3 images.
Version 1.1.0 was not showing any default preloading behavior.
from react-native-image-gallery.
@syedabdulbaqi you could give this pull request a try and confirm if @Exilz should review it.
from react-native-image-gallery.
Related Issues (20)
- Laggy when using setParams react navigation on page selected HOT 1
- how to stop photo from swiping vertically when scrolling horizontally
- Warning: componentWillMount/ componentWillReceiveProps deprecated HOT 1
- Example using image in storage
- Feature Request
- infinite scrolling feature
- This library is not MAINTAINED! HOT 7
- keyExtractor HOT 1
- detect when swiped at the last image
- Animated 'useNativeDriver' was not specified HOT 6
- Exit button is not defined by default? HOT 1
- page Scroll not working
- How can i get zoom scale
- zoom to area??
- initialPage doesn't work above index value of 9
- The Gallery seems to break after removing the last image HOT 1
- How to enlarge a picture without shrinking it?Could anyone do me a favor?
- Android header space
- How to zoom image via double tap.
- css part
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-image-gallery.