Skip to content

Instantly share code, notes, and snippets.

@cawfree
Last active July 17, 2023 10:09
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cawfree/28fc3d425a1489ebd290da678551f58b to your computer and use it in GitHub Desktop.
Save cawfree/28fc3d425a1489ebd290da678551f58b to your computer and use it in GitHub Desktop.
How to use React Native and MacOS Catalyst

Follow these steps to run your React Native application using MacOS Catalyst.

  1. Use the following package versions:
+ "metro-react-native-babel-preset": "^0.59.0",
+ "react-native": "0.63.0",
+ "react-native-macos": "^0.63.23",
  1. Update your metro.config.js to recognize MacOS support files:
{
+  resolver: {
+    platforms: ["ios", "android", "native", "macos"],
+  }
}
  1. Deactivate Flipper/Folly and remove references to flipper_post_install.
  2. Update your Podfile to automatically sign MacOS dependencies:
  post_install do |installer|
+    # Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
+    installer.pods_project.targets.each do |target|
+      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
+          target.build_configurations.each do |config|
+              config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = '-'
+          end
+      end
+    end
  end
  1. Remove your Podfile.lock and re-run npx pod-install.
  2. In your Project, select MacOS as the deployment target and verify that you wish to add MacOS Support Files.

And we're done! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment