Skip to content

Commit fca84d8

Browse files
authored
refactor: use install_modules_dependencies method only if react native version >=0.71.0 (#358)
This pull request replaces all the inline IOS dependencies in **podspec** and uses `install_modules_dependencies` method to depend on React Native core changes.
1 parent 6582785 commit fca84d8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/create-react-native-library/templates/native-common/{%- project.identifier %}.podspec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Pod::Spec.new do |s|
2222
s.source_files = "ios/**/*.{h,m,mm}"
2323
<% } -%>
2424
25+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
26+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
27+
if respond_to?(:install_modules_dependencies, true)
28+
install_modules_dependencies(s)
29+
else
2530
s.dependency "React-Core"
2631
2732
# Don't install the dependencies when we run `pod install` in the old architecture.
@@ -40,5 +45,6 @@ Pod::Spec.new do |s|
4045
s.dependency "RCTRequired"
4146
s.dependency "RCTTypeSafety"
4247
s.dependency "ReactCommon/turbomodule/core"
43-
end
48+
end
49+
end
4450
end

0 commit comments

Comments
 (0)