Skip to content

Commit

Permalink
Fix ios pod post_install logic for detecting if fabric is enabled (#4…
Browse files Browse the repository at this point in the history
…1284)

Summary:
There is a problem in the way that we check if Fabric is enabled inside `react_native_post_install`.

https://github.com/facebook/react-native/blob/899e7cdb55197fc17a96a93af4f8bcc7519553c2/packages/react-native/scripts/react_native_pods.rb#L239

We're determining if fabric is enabled by checking if the `React-Fabric pod `is present, but since we always call `setup_fabric!(:react_native_path => prefix)`  (#39057) inside `use_react_native` the `React-Fabric` pod is always present causing the `-DRN_FABRIC_ENABLED` flag to always be added to `project.pbxproj` even if the new arch is disabled.

[IOS] [FIXED] - Fix ios pod post_install logic for detecting if fabric is enabled

Pull Request resolved: #41284

Test Plan: Run `use_react_native!(fabric => false)` should not add the `-DRN_FABRIC_ENABLED` flag to `project.pbxproj`

Reviewed By: fkgozali

Differential Revision: D50896487

Pulled By: cipolleschi

fbshipit-source-id: 78154407ce52b09fd3a317b7dc64bd4bba56363e
  • Loading branch information
gabrieldonadel authored and Luna Wei committed Nov 2, 2023
1 parent 9b97cd9 commit 8414427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-native/scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def react_native_post_install(
flipper_post_install(installer)
end

fabric_enabled = ReactNativePodsUtils.has_pod(installer, 'React-Fabric')
fabric_enabled = ENV['RCT_FABRIC_ENABLED'] == '1'
hermes_enabled = ReactNativePodsUtils.has_pod(installer, "React-hermes")

if hermes_enabled
Expand Down

0 comments on commit 8414427

Please sign in to comment.