• Complain

Cássio de Sousa Antonio - Pro React

Here you can read online Cássio de Sousa Antonio - Pro React full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA, year: 2015, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Cássio de Sousa Antonio Pro React

Pro React: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Pro React" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Cássio de Sousa Antonio: author's other books


Who wrote Pro React? Find out the surname, the name of the author of the book and a list of all author's works by series.

Pro React — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Pro React" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Cssio de Sousa Antonio 2015
Cssio de Sousa Antonio Pro React 10.1007/978-1-4842-1260-8_1
1. Getting Started
Cssio de Sousa Antonio 1
(1)
ap, Brazil
Electronic supplementary material
The online version of this chapter (doi: 10.1007/978-1-4842-1260-8_1 ) contains supplementary material, which is available to authorized users.
React is an open-source project created by Facebook. It offers a novel approach towards building user interfaces in JavaScript. Since its initial public release, the library has experienced a fast adoption rate and has created a vibrant community around it.
Over the course of the book, you will learn everything you need to know to get the benefits of React in your projects. since React is only concerned about rendering the UI and makes no assumptions about the rest of your technology stack, this book will you walk through the routing and application architectures that fit in the librarys patterns.
In this chapter, we will go through a few topics at a high level so you can start building applications as quickly as possible. The topics well cover include the following:
  • A complete definition of React and an overview of its benefits
  • How to use JSX, a JavaScript syntax extension used in React for expressing UI
  • How to create React components, complete with props and state
Before You Get Started
React fits in the modern JavaScript development ecosystem. To code along with the examples in this book, you will need to have Node.js and npm installed. You should also be familiar with functional JavaScript paradigms as well as some of the languages newest features, such as arrow functions and classes.
Node.js and npm
JavaScript was born to run on the browser, but Node.js makes it possible to run JavaScript programs on your local computer and on a server through its open source command line tool. Together with npm (Node Package Manager), Node.js has become invaluable for local development of JavaScript-heavy applications, allowing a developer to create scripts for running tasks (such as copying and moving files or starting a local development server, for example) and to automatically download dependencies.
If you dont have Node.js installed, take your time to install it now by downloading the installer for Windows, Mac or Linux at https://nodejs.org/ .
JavaScript ES6
JavaScript is a live language that has been evolving over the years. Recently the community agreed on a set of improvements for the language. Some of the most recent browsers have already implemented such features, and the React community makes extensive use of them (arrow functions, classes, and the spread operator, to name a few). React also encourages the use of functional patterns in JavaScript, so its important that youre familiar with how functions and context works in the language and that you understand methods such as map , reduce , and assign . If you are a little hazy on some of these details, online appendixes on these subjects are provided on the Apress website ( www.apress.com/ ) and on the books GitHub page ( http://pro-react.github.io/ ).
Defining React
To get a clear understanding of what exactly React is, I like to define it as this:
React is an engine for building composable user interfaces using JavaScript and (optionally) XML.
Lets break down this statement to analyze each part:
  • React is an engine: Reacts site defines it as a library, but I like to use the term engine because it helps convey one of Reacts core strengths: its approach to reactive UI rendering. This approach separates state (all the internal data that defines the application at a given point in time) from the UI presented to the user. With React, you declare how state is represented as visual elements of the DOM and from then on the DOM is automatically updated to reflect state changes.
  • The term engine was first used to describe React by Justin Deal because it reminded him of the similarity between reactive rendering and the way game engines work ( https://zapier.com/engineering/react-js-tutorial-guide-gotchas/ ).
  • for creating composable user interfaces: Reducing the complexity of creating and maintaining user interfaces is at the heart of React. It embraces the concept of breaking the UI into components, self-contained concern-specific building blocks, which are easy to reuse, extend, and maintain.
  • using JavaScript and (optionally) XML: React is a pure JavaScript library that can be used on the browser, the server, and mobile devices. As you will see in this chapter, it has an optional syntax that allows you to use XML to describe your UI. As strange as it may look at first, it turns out that XML is great for describing user interfaces: its declarative, its easy to spot the relationship between elements, and its easy to visualize the overall structure of your UI.
Reacts Benefits
There are a lot of JavaScript MVC frameworks out there. So why did Facebook build React and why would you want to use it? In the next three sections, well explore some of its benefits in order to answer this question.
Reactive Rendering is Simple
In the early days of web development, way before the concept of single page applications, for every interaction the user performed on a page (like hitting a button), a whole new page was sent from the server, even if this new page was only a slightly different version of the page the user was on. That made for a terrible experience from the point of view of the user, but for the developer it was very easy to plan what exactly the user would see at a given interaction or a given point.
Single page applications are constantly fetching new data and transforming parts of the DOM as the user interacts. As interfaces grow more complex, it gets more and more complicated to examine the current state of the application and make the necessary punctual changes on the DOM to update it.
One technique used by many JavaScript frameworks (especially before React appeared) to tackle this increasing complexity and keep the interface in sync with state is data binding, but this approach comes with disadvantages in maintainability, scalability, and performance.
Reactive rendering is easier to use than traditional data binding. It lets us write in a declarative way how components should look and behave. And when the data changes, React conceptually renders the whole interface again.
Since its not viable for performance reasons to actually trash and re-render the entire interface every time state data changes, React uses an in-memory, lightweight representation of the DOM called virtual DOM.
Manipulating the in-memory representation of the DOM is faster and more efficient than manipulating the real DOM. When the state of the application changes (as the result of an user interaction or data fetching, for example) React quickly compares the current state of the UI with the desired state and computes the minimal set of real DOM mutations to achieve it. This makes React very fast and efficient. React apps can easily run at 60fps, even on mobile devices.
Component-Oriented Development Using Pure JavaScript
In a React application, everything is made of components, which are self-contained, concern-specific building blocks. Developing applications using components allows a divide and conquer approach where no particular part needs to be especially complex. They are kept small and because they can be combined, its easy to create complex and more feature-rich components made of smaller components.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Pro React»

Look at similar books to Pro React. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Pro React»

Discussion, reviews of the book Pro React and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.