Configuring ReactJS On MacOS: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "== Prerequisites == The React docs recommend using `npm` to create a new React app. <ref>[https://reactjs.org/docs/add-react-to-a-new-app.html Create React App], React Docs</...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category:ReactJS]][[Category:Web Development]]
== Prerequisites ==
== Prerequisites ==


Line 33: Line 34:
$ npm start
$ npm start
</syntaxhighlight>
</syntaxhighlight>
After running the app with `npm start` the app will be available at http://localhost:3000


== IDE ==  
== IDE ==  

Latest revision as of 17:30, 2 March 2018

Prerequisites[edit]

The React docs recommend using npm to create a new React app. [1]

npm requires Node >= 6.

To install npm and node: [2]

  1. Install XCode from the Apple App Store.
  2. Install homebrew:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Use homebrew to install node:
    brew install node
  4. Confirm that node is installed:
    node -v
  5. Confirm that npm is installed:
    npm -v

Creating a new React app[edit]

Use npm to install the utility that creates new React app boilerplate (this only needs to be done once):

$ npm install -g create-react-app

Use create-react-app to create a new app:

$ create-react-app my-app

Start the app:

$ cd my-app
$ npm start

After running the app with npm start the app will be available at http://localhost:3000

IDE[edit]

WebStorm by JetBrains (I have a license)

Notes[edit]