-
Notifications
You must be signed in to change notification settings - Fork 421
Updating from an existing project to version 0.18.x
These instructions detail how to update from an existing version 0.16.1 project to 0.18.0-alpha.3.
First, install the latest react-native-macos, then add the new dependency babel-plugin-module-resolver:
yarn add react-native-macos@latest
yarn add -D babel-plugin-module-resolverIf you don't have one already, make a new file called rn-cli.config.js, and ensure the following text is present, as per ptmt's recommendation:
'use strict';
module.exports = {
getProvidesModuleNodeModules: () => ['react-native-macos'],
getPlatforms: () => 'macos',
};Now you'll need to update the location of the packager script. In Xcode, select your build target from your project settings, then navigate to Build Phases > Bundle React Native code and images, and update the location of the packager script from ../node_modules/react-native-macos/packager/react-native-xcode.sh to the subtly different:
export NODE_BINARY=node
../node_modules/react-native-macos/scripts/react-native-xcode.sh
I cleaned my Xcode project at this point for good luck. Final step:
npm start -- --reset-cacheNow just run the Xcode project.
If you experience the dreaded __nw_connection_get_connected_socket_block_invoke Connection has no connected handler log-spamming error, then it sounds like you should keep a copy of react-devtools open:
yarn global add react-devtools
react-devtoolsHaven't tried this, but it should work like this:
yarn add react-devtools
node_modules/.bin/react-devtools