Disabling batchRenderingUpdatesInEventLoop in React Native (New Architecture)

Problem

There is currently a known issue in React Native New Architecture that affects how native view commands are dispatched on iOS. Since Fullstory leverages native view commands to read custom Fullstory attributes, e.g. fs-class, fs-attributes, this race condition may cause Fullstory to delay capture of these attributes, or fail to capture these attributes altogether.

The result of this issue may result in Private by Default masking of unmasked elements, or capturing excluded elements as masked elements.

React Native has since fixed this issue as of version 0.77.0, but for earlier versions, this fix either may not be available, or is hidden behind a feature flag called enableFixForViewCommandRace.

Solution

Versions >= 0.74.1 and < 0.77.0

To ensure availability of custom attributes and accurate privacy settings on your React Native elements, we suggest setting batchRenderingUpdatesInEventLoop to false in packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm. Turning off batch rendering updates will disable the delay in view creation and allow view commands to reference its view in memory when dispatched.

class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
  public:
  bool batchRenderingUpdatesInEventLoop() override
    {
      - return true;
      + return false;
    }
};

Versions >= 0.77.0

No additional action needed. The React Native team has enabled the fix behind the feature flag enableFixForViewCommandRace and this bug has been resolved.


Was this article helpful?

Got Questions?

Get in touch with a Fullstory rep, ask the community or check out our developer documentation.