layout | permalink |
---|---|
page |
/react-intro/ |
- A Javascript UI framework based on declarative views
- Generate page with nested function calls that take data as input and produce HTML as output
- Older UI frameworks built DOM trees imperatively
- HTML initially be created on the server
- Data stored on the HTML elements as attributes
- A lot of re-rendering (performance penalty)
- Tied tightly to browsers (in a world with a growing variety of devices)
- DOM nodes are no longer a source of data
- Declarative view rendering and composition removes the need to understand DOM state when updating views
- View implementation details are easier to modularize
- It's faster: React only re-renders those parts of the view that need to be updated
-
Install the latest Long-term Support (LTS) version of NPM and Node v6+ from http://nodejs.org/download/
- The download above should install two commands:
node
andnpm
npm
may require some extra configuration to set permissions properly
- The download above should install two commands:
-
A code editor
-
create-react-app
command-line tool:npm install --global create-react-app
- Command-line tool that creates a React application with a standard structure and dependencies
create-react-app robodex
: creates the app in the folderrobodex
package.json
: information on what dependencies your application has as well as some simple commandsREADME.md
: documentation on React andcreate-react-app
- Replace this with a description of your application
node_modules
: dependency filessrc
: application source filespublic
: the build target path
npm start
: serves the application in a development environment- Code changes are automatically refreshed in the browser
npm build
: builds the application for deployment and copies the files to thepublic
foldernpm test
: runs the application's testsnpm eject
: ejects the build configuration- Don't do this!
- (for advanced users only) Don't do this yet