Skip to content

Canvas flickers when parent view zIndex changes to 0 [Android] #3713

@AdamGerthel

Description

@AdamGerthel

Description

This is an issue I've stumbled on which is currently causing a lot of flickering in our games, and I've finally managed to isolate it to a simple example.

When a view receives zIndex 0, it will cause any canvas that's inside that view (even deeply nested) to flicker/redraw. It does not matter if the component that contains the canvas is memoized and doesn't re-render, so it seems it's happening entirely on the native side.

In our games this bug appears on any zIndex change in a parent, not only with zIndex: 0, but in an isolated example I've only managed to reproduce it with 0.

flicker.mov

React Native Skia Version

2.4.21 but it happens in 2.2 as well. Only affects Android. Am pretty sure the issue started after upgrading to the new arch (Expo SDK 53).

React Native Version

0.81.5 but it happens in more recent versions as well

Using New Architecture

  • Enabled

Steps to Reproduce

See repository

Snack, Code Example, Screenshot, or Link to Repository

https://github.com/AdamGerthel/react-native-skia-flicker-issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions