Comments (7)
I tested and now I understand the bug.
I can't render ImageView with the initial image being null.
Which means that I need to create some dummy image for it to work.
This will not work:
const DEFAULT_STATE: any = {
item: null,
key: 0,
isImageViewVisible: false
}
from react-native-image-view.
When I replace the 'images' through reducer the ImageView still shows me the default image.
ImageView images={[this.props.item]}
imageIndex={0}
animationType='fade'
isVisible={this.props.isImageViewVisible}
Which means that changing 'images' doesn't work. The component retains the first 'images' given.
from react-native-image-view.
The problem is that you take the 'images' from state instead of props.
Instead of:
render(): Node {
const {animation, renderFooter} = this.props;
const {images, imageIndex, isVisible, scrollEnabled} = this.state;
you need to do this:
render(): Node {
const {images, animation, renderFooter} = this.props;
const {imageIndex, isVisible, scrollEnabled} = this.state;
from react-native-image-view.
Thanks for issue, let me investigate it. The problem is that in this version there are a lot of logic happens when component receive new images. I think you right and maybe it is not necessary to store images in state, but I need some free time to test it all. Or you can send PR :)
from react-native-image-view.
Sorry, don't have the time.
from react-native-image-view.
Any progress with this issue?
It seems the takes first image passed to it even when the whole page re-renders. Is there a way to dynamically change the set of images passed to it?
from react-native-image-view.
If you want to fix it yourself, you just need to take the images in render() from props instead of state.
from react-native-image-view.
Related Issues (20)
- The swipe function is fine, but pinch zoom is very unstable. HOT 5
- Zoom issue when height is bigger than width HOT 2
- loading spinner stopped working HOT 2
- how could we display the complete images when we click on them?
- How to render only one image HOT 1
- Endless loading spinner
- Image does not load HOT 2
- onClose is not working properly, after onClose={() => this.setState({ isImageViewVisible: false })} image not closing the modal
- renderFooter can not display HOT 2
- Position fixed to top
- Ended a touch event which was not counted in `trackedTouchCount`.
- useNativeDriver Warning HOT 6
- android render image issue
- Wrong image show when orientation changes
- Loading each time an image is opened on iOS
- Update animation to include useNativeDriver Property HOT 1
- Expo-web support?
- Android back button does not work to exit the viewed image
- Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false` HOT 3
- added support for new reanimated version HOT 1
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-view.