Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image flickers within Carousel when state is updated. #32

Closed
crjc opened this issue Nov 10, 2021 · 4 comments
Closed

Image flickers within Carousel when state is updated. #32

crjc opened this issue Nov 10, 2021 · 4 comments
Assignees

Comments

@crjc
Copy link

crjc commented Nov 10, 2021

Images rendered within the carousel are flickering when state is updated within the component holding the carousel.

I am using iOS and the latest version of Expo.

When you have a carousel which has an Image or BackgroundImage returned by renderItem, the images will flicker when setState is used.

example:

const example: FC = () => {
    const [ value, setValue ] = useState(0);

    // update the state every second
    // this will cause the flicker.
    useEffect(() => {
        setTimeout(() => setValue(value + 1), 1000);
    }, [value]);

    return (
        <Carousel
             data={[1,2,3,4]}
             renderItem={() => <Image width={100} height={100} source={require('...someimage...')} />}
             width={100}
             loop={false}
        />
    );
};
@crjc
Copy link
Author

crjc commented Nov 10, 2021

I am able to reproduce on physical iOS devices, and on the Android simulator on this snack: https://snack.expo.dev/@crjc/flickery-image

Note, I'm not seeing the issue on the iOS simulator for the snack, but when I run it on my device the issue is visible.

@dohooo
Copy link
Owner

dohooo commented Nov 11, 2021

Ok let me see why…

@dohooo
Copy link
Owner

dohooo commented Nov 16, 2021

I am sorry that I have been busy recently. I am still paying attention to the problem and I will fix it as soon as possible, maybe this week.

@dohooo dohooo self-assigned this Nov 19, 2021
@dohooo dohooo added this to To do in Tasks dashboard. Nov 20, 2021
@dohooo dohooo moved this from To do to In progress in Tasks dashboard. Nov 20, 2021
@dohooo dohooo moved this from In progress to In test in Tasks dashboard. Nov 20, 2021
@dohooo dohooo moved this from In test to In progress in Tasks dashboard. Nov 20, 2021
@gxxgcn gxxgcn moved this from In progress to In test in Tasks dashboard. Nov 20, 2021
@gxxgcn gxxgcn closed this as completed in d34d71d Nov 20, 2021
Tasks dashboard. automation moved this from In test to Done Nov 20, 2021
@dohooo
Copy link
Owner

dohooo commented Nov 20, 2021

v1.0.5

THX! 🍺!!~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants