Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the Native RuntimeScheduler is initialized on Old Arch #37517

Closed
wants to merge 1 commit into from

Commits on May 22, 2023

  1. Make sure the Native RuntimeScheduler is initialized on Old Arch (fac…

    …ebook#37517)
    
    Summary:
    Pull Request resolved: facebook#37517
    
    Fixes facebook#35778
    
    We got reports of regressions on `useEffect` starting from 0.69+ when on Hermes.
    
    The issue seems to be caused by a bump of the `scheduler` package from 0.20 to 0.21.
    In scheduler@0.21, the method `setImmediate` gets called if available
    (see facebook/react#20834). This causes React Native to use Microtasks
    which ends up in changing the semantic of useEffect.
    
    The solution is to use the Native RuntimeScheduler properly.
    On Paper specifically, we never initialized it as it's effectively initialized by the
    TurboModuleManagerDelegate. Here I trigger the initialization of it on Paper as well.
    
    Changelog:
    [Android] [Fixed] - Make sure the Native RuntimeScheduler is initialized on Old Arch
    
    Reviewed By: sammy-SC
    
    Differential Revision: D46024807
    
    fbshipit-source-id: 133d6de5d42f00718092601efc8b7862eda646c9
    cortinico authored and facebook-github-bot committed May 22, 2023
    Configuration menu
    Copy the full SHA
    9a5811a View commit details
    Browse the repository at this point in the history