reactwg / react-native-releases

React Native Releases Working Group
363 stars 7 forks source link

[0.76] Only import autolinkng.h on the New Architecture #640

Open cipolleschi opened 1 week ago

cipolleschi commented 1 week ago

Target Branch(es)

0.76

Link to commit or PR to be picked

https://github.com/facebook/react-native/commit/b8419b2eed772ecaa927a5ac777150d8a8f7b6c5

Description

The OnLoad.cpp always imports the <autolinking.h> file even in the Old Architecture but that file is only generated when the New Architecture is enabled.

This changes add a check to make sure that we import the file only when it actually exists.