Skip to content

[2/3] Add (and upstream) option to toggle between CompositionTarget::Rendering and UI.Composition animations #9284

@rozele

Description

@rozele

Summary

There are still many issues with the UI.Composition approach for NativeAnimated. In #9249, we extended the animation drivers and nodes to use CompositionTarget::Rendering to solve problems like jitter when restarting animations, options to animate arbitrary props (e.g., borderRadius on native components, etc.

This change forks the Animated JS code to support platform configuration inheritance, so native Animated nodes created for a particular animation graph inherit the platform config from the animation driver (or tracking animation config).

Motivation

There are quite a few remaining bugs with the UI.Composition approach for NativeAnimated, some can be resolved, some likely can't even with fixes to the underlying XAML APIs in WinUI 3. This change allows most users to continue using UI.Composition animations if they are happy with them, or fallback to CompositionTarget::Rendering (dependent) animations if they are not.

Basic Example

const value = Animated.Value(0);
Animated.timing({
  duration: 1000,
  toValue: 1,
  useNativeDriver: true,
  platformConfig: {
    useComposition: false
  });

Open Questions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions