Skip to content

CSS Transitions hijacks ShadowTree updates for attached nodes #8513

@jpudysz

Description

@jpudysz

Description

Hey!

A new issue came up and was reported by a Unistyles user. When both a CSS Transition and a Unistyles style are attached to the same component, theme changes don’t apply to those nodes.

I debugged it, my ShadowTree update sends the correct values, but it looks like CSS Transition nodes are handled differently on your side, which blocks me from applying any updates on top.

That’s not the case for regular Animated components using useAnimatedStyle. Could you let me know why this happens and more importantly how I can push an update for those nodes?

At first I thought it was because you spread the styles, but after checking your filterNonCSSStyleProps function, I realized that was a wrong assumption.

Steps to reproduce

  1. Open the app
Image
  1. Tap on "Check box" button
  2. One button will change color immediately and second one will slowly transition
Image
  1. Tap on "Change theme" button
  2. One button won't take in count new color applied by Unistyles (from ShadowTree)
Image Image

Shadow tree styles pushed to ShadowTree by Unistyles are correct:

Image

Each section represent one ShadowNode and styles that should be applied.

Original issue: jpudysz/react-native-unistyles#1007

Snack or a link to a repository

https://github.com/believer/unistyles-repro

Reanimated version

4.1.3

Worklets version

0.6.1

React Native version

0.81.4

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native CLI

Architecture

New Architecture (Fabric renderer)

Build type

Debug app & dev bundle

Device

iOS simulator

Host machine

macOS

Device model

iPhone 16e

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: AndroidThis issue is specific to AndroidPlatform: iOSThis issue is specific to iOSRepro providedA reproduction with a snippet of code, snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions