Skip to content

Commit ed16a5e

Browse files
shirakabatido64
andauthored
feat: add react-native-macos support (#513)
* Move example -> example-prev * Init React Native Test App yarn init-test-app --version 0.73.0 (and manually bump react-native-* versions afterwards) * Merge example-prev into example * Add osx to podspec * Fix metro config to resolve react-native-safe-area-context * Install pods * Write macOS equivalents for all iOS code * Raise macOS deployment target to 10.15 * Delete example-prev * Trying and failing to get macOS app to build * Apply Tommy Nguyen's suggestions to fix pod installation Co-authored-by: Tommy Nguyen <[email protected]> * Stop using compat components for macOS * Restore example to its original state * Add example-macos * Reduce macOS deployment target to 10.15 * Make example-macos use RNTesterApp instead of bespoke app * Remove example-macos * Pin react-native and react-native-macos to v0.74 * Init [email protected] project I temporarily renamed the "name" field in package.json to "RNSACExample", then ran `npx react-native-macos-init` to generate a project by that name. * Fix bundleURL microsoft/react-native-macos#2164 (comment) * Fix Metro config * Run yarn format:write --------- Co-authored-by: Tommy Nguyen <[email protected]>
1 parent cc52b98 commit ed16a5e

34 files changed

+3826
-407
lines changed

example/ios/Podfile.lock

+238-238
Large diffs are not rendered by default.

example/macos/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# CocoaPods
2+
Pods/

example/macos/.xcode.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export NODE_BINARY=$(command -v node)

example/macos/Podfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
require_relative '../node_modules/react-native-macos/scripts/react_native_pods'
2+
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3+
4+
prepare_react_native_project!
5+
6+
target 'RNSACExample-macOS' do
7+
platform :macos, '10.15'
8+
use_native_modules!
9+
10+
# Flags change depending on the env values.
11+
flags = get_default_flags()
12+
13+
use_react_native!(
14+
:path => '../node_modules/react-native-macos',
15+
:hermes_enabled => false,
16+
:fabric_enabled => ENV['RCT_NEW_ARCH_ENABLED'] == '1',
17+
# An absolute path to your application root.
18+
:app_path => "#{Pod::Config.instance.installation_root}/.."
19+
)
20+
21+
post_install do |installer|
22+
react_native_post_install(installer)
23+
end
24+
end

0 commit comments

Comments
 (0)