How do I add react-native-macos to an existing React Native project?

Author: ndbroadbentCreated May 17, 2017Updated Sep 24, 2019
Labelsproposal

I have an existing React Native project with iOS, Android, Windows, and web. I would also like to experiment with support for MacOS.

Is there a command I can run that will add a "mac" directory? It would be great if the README could be updated with these instructions.

EDIT: Ok it wasn't too hard, I just ran the init command, then copied macos into my app, and updated my package.json to include react-native-macos.

EDIT 2: Ok damn, now I'm getting a ton of these errors:

This error is caused by a @providesModule declaration with the same name across two different files.
Error: @providesModule naming collision:
  Duplicate module name: ReactNative
  Paths: <myapp>/node_modules/react-native-macos/Libraries/react-native/ReactNative.js collides with <myapp>/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNative.js 

Do I need to replace react-native with react-native-macos? Would it be possible for you to fix this in a similar way to react-native-windows?