All Projects → ktonon → react-native-port-patcher

ktonon / react-native-port-patcher

Licence: other
Replace all instances of hard coded port 8081 in react-native package

Programming Languages

javascript
184084 projects - #8 most used programming language

react-native-port-patcher

Attempts to resolve this issue: https://productpains.com/post/react-native/allow-packager-port-to-be-configurable-change-from-8081/

HowTo

Install it as a dev-dependency in your react-native project:

npm install -D react-native-port-patcher

Then update your package.json to include:

  "scripts": {
    "postinstall": "react-native-port-patcher --new-port 8088"
  }

Now after you yarn or npm install, the script will find your react-native package and @react-native-community projects under node_modules and regex search/replace all instances of /\b8081\b/g with the port you provide.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].