Giter Club home page Giter Club logo

Comments (7)

MaximRikel avatar MaximRikel commented on May 27, 2024

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.

MaximRikel avatar MaximRikel commented on May 27, 2024

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.

MaximRikel avatar MaximRikel commented on May 27, 2024

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.

antonKalinin avatar antonKalinin commented on May 27, 2024

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.

MaximRikel avatar MaximRikel commented on May 27, 2024

Sorry, don't have the time.

from react-native-image-view.

vorasudh avatar vorasudh commented on May 27, 2024

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.

MaximRikel avatar MaximRikel commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.