Today I Learned

hashrocket A Hashrocket project

Custom Port with Create React App

When you know create-react-app will never be using port 3000 you can specify an alternate port, to avoid being prompted all the time.

Just pre-pend the port to the start script:

{
  "name": "custom-port",
  "version": "0.1.0",
  ...
  
  "scripts": {
    "start": "PORT=3001 react-scripts start",
    ...
  }
}
See More #react TILs
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.