SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Set up experiment to fix the mapping of event priorities between Fabric and React (#45013)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45013

Changelog: [internal]

## Context

We recently realized that in the majority of events dispatched to React from Fabric, passive effects were being mounted synchronously, blocking paint instead of in a separate task after paint.

The reason for that is that in React, passive effects for discrete events are mounted synchronously by design (see https://github.com/reactwg/react-18/discussions/128), and Fabric is currently assigning the discrete event priority to most current events (including things like layout events).

## Changes

This creates a feature flag to opt into a more granular control over event priorities in React Native. Instead of assigning the discrete event priority to events by default, this would assign the "default" event priority by default, except for events dispatched during continuous events that would also be considered continuous.

This would also fix the priority for continuous events, that it was currently being assigned as "default" incorrectly.

Reviewed By: christophpurrer, javache, sammy-SC

Differential Revision: D58677191

fbshipit-source-id: c65a8dc2118ed028e1e895adec54f9072b7e55a6
R
Rubén Norte committed
404f323359f9af469ba60132d802ffa0b2d72675
Parent: 43d69ee
Committed by Facebook GitHub Bot <[email protected]> on 6/18/2024, 12:24:57 PM