Обучающие видео » Компьютерные видеоуроки и обучающие интерактивные DVD » Программирование (видеоуроки)
React.js (with Introduction to Flux Architecture)Год выпуска: 2015
Производитель: frontendmasters.com
Сайт производителя:
https://frontendmasters.com/courses/react-intro-to-flux/Автор: Ryan Florence
Продолжительность: 4 hours, 29 min
Тип раздаваемого материала: Видеоклипы
Язык: Английский
Описание: his course has been archived. We have a new React course: Complete Intro to React (feat. Redux & React Router). React is a JavaScript library for creating user interfaces by Facebook and Instagram. React.js creates its own virtual DOM where your components actually live. This virtual DOM approach gives enormous flexibility and amazing gains in performance because React.js calculates what changes need to be made in the DOM beforehand and updates the DOM tree accordingly. Discover JSX (and the ES6 features that come along with it), creating React custom components, integrating React with jQuery UI / Bootstrap components and learn how to iterate React into an existing codebase in this course.
Code (Github) -
http://github.com/FrontendMasters/2015-02-13-React/[spoiler="Содержание"]
Table of Contents
Let’s Build an App with React
React Introduction
00:00:00 - 00:10:57
React Introduction
Ryan Florence begins the course with a brief explanation of how to download and install the course files. He then codes a simple application to demonstrate the React development workflow. Ryan also discusses at a high level the ECMAScript 6 features that ship with React. -
http://github.com/FrontendMasters/2015-02-13-React/React Introduction Questions
00:10:58 - 00:15:00
React Introduction Questions
With the first React application finished, Ryan takes a few minutes to answer some audience questions. He discusses the Webpack build process and how the output is generated.
Your First Component
JSX vs. Pure JavaScript
00:15:01 - 00:21:36
JSX vs. Pure JavaScript
DOM elements can be created with JavaScript functions or with JSX. JSX is often preferred because it looks like HTML and is easier to visualize. When the application is built, the JSX code is transpiled back into JavaScript functions so there isn’t any performance difference between these two methods.
Composite Components
00:21:37 - 00:26:29
Composite Components
When you use the React.createClass method, you are creating a composite component. These components use a render() method to return the user interface elements.
Exercise 1: Rendering Data
00:26:30 - 00:31:25
Exercise 1: Rendering Data
Ryan introduces the first exercise. In this exercise, you will need to to render the data stored in the DATA property to the page. Ryan gives a few hints on how to get started as well as a brief code snippet on how to inject data into JSX. - exercises/1-your-first-component
Exercise 1: Solution
00:31:26 - 00:40:50
Exercise 1: Solution
Ryan walks through the solution to Exercise 1. He also explains the ReactElement object in a little more detail.
Props
Creating Props
00:40:51 - 00:51:52
Creating Props
All UI elements in React are JavaScript functions. Props are the primary interface for all these functions and they can alter the way elements are rendered. While there are many Props available as attributes of HTML elements, developers can also create their own custom Props. Ryan demonstrates how to create a Gravatar class with a few custom Props.
PropTypes and Keys
00:51:53 - 01:03:24
PropTypes and Keys
The propTypes property of a React component allows developers to declare the data type of each prop. Custom propTypes can also be created. Ryan gives a propTypes demonstration and also explains why specifying keys are helpful when working with arrays.
Exercise 2: Props
01:03:25 - 01:05:09
Exercise 2: Props
In this exercise, you will add a prop so the USERS array is not accessed directly in the application. You will also use PropTypes to add data validation. - exercises/2-props/
Exercise 2: Solutions
01:05:10 - 01:14:22
Exercise 2: Solutions
After answering a couple audience questions, Ryan demonstrates the solution to Exercise 2.
Events and State
Understanding Events
01:14:23 - 01:22:46
Understanding Events
One way to add events to DOM element in React is within the JSX code. Events can be added inline as a prop. Custom parameters can be passed to event handlers by utilizing the bind() method. Ryan demonstrates this technique and answers a few audience questions about debugging.
Setting State
01:22:47 - 01:29:40
Setting State
Generally, it’s better if components don’t have state and only function based on the props they are passed. However, when state is required, React has an API for setting the initial state and updating the state. Ryan creates a summary/details component to explain how React manages state.
State Best Practices
01:29:41 - 01:38:11
State Best Practices
Ryan demonstrates how to keep the render() method “stateless”. By doing this, the component will render no matter what state is currently set. He also talks in more depth about the setState method and how it triggers a new render cycle.
Exercise 3: Events and States
01:38:12 - 01:41:57
Exercise 3: Events and States
In this exercise, you will create a tabs component. You will need to add events and manage the state of the component to make the correct content show as the users clicks each tab. - exercises/3-events-and-states
Exercise 3: Solution
01:41:58 - 01:53:27
Exercise 3: Solution
Ryan demonstrates the solution to Exercise 3. He also addresses a few questions about styles and the use of the bind method.
Props vs. States
Props vs States vs Stores
01:53:28 - 02:06:03
Props vs States vs Stores
Props and States can behave in similar ways. When to use a Prop versus a State depends on what you need to do with the data. Ryan explains the differences between Props, States and Stores and demonstrates why trying to manage multiple states can be problematic.
Replacing States with Props
02:06:04 - 02:15:10
Replacing States with Props
Since managing multiple States for related objects can be confusing, Ryan walks through an example where he replaces the State management with PropsTypes. This way all toggle components will be managed by the parent.
Implementing toggleAll
02:15:11 - 02:22:49
Implementing toggleAll
Now that all toggle components are managed by their parent, the toggleAll method can be implemented. Ryan adds the toggleAll functionality and also briefly discusses the JavaScript reduce() method.
Exercise 4: Props v State
02:22:50 - 02:23:59
Exercise 4: Props v State
In this exercise, you will make the tabs component a “pure component” by not managing any of its own states. - exercises/4-props-v-state
Exercise 4: Solution
02:24:00 - 02:29:21
Exercise 4: Solution
Ryan demonstrates the solution to Exercise 4. He also talks a little more in detail about why you would want the parent to control which tab is active and answers a few audience questions.
Flux
Flux Overview
02:29:22 - 02:35:02
Flux Overview
Ryan begins his discussion about Flux by showing a diagram that illustrates what Flux provides. Action Creators spawned by events in the application will facilitate the communication with the server through web APIs. A Dispatcher will then complete the cycle through a system of callbacks to update any Stores and allow the change events to be processed by the UI.
Flux Example
02:35:03 - 02:43:21
Flux Example
Ryan walks through the code of a simple application that uses Flux. He shows how each Action is created and how the UI is passed the data retrieved from the server. He also talks briefly about tokens and how they aid in the management of dependent Stores.
Exercise 5: Flux
02:43:22 - 02:50:15
Exercise 5: Flux
In this exercise, you will modify the Flux application so it can delete a contact from the database. Before starting the exercise, Ryan answers a few audience questions and provides some direction on where to begin. - exercises/5-flux
Exercise 5: Solution
02:50:16 - 02:56:25
Exercise 5: Solution
Ryan begins explaining the solution to Exercise 5.
Exercise 5: Solutions, continued
02:56:26 - 03:06:32
Exercise 5: Solutions, continued
After adding all the code for the solution to Exercise 5, Ryan walks through the solution one more time to reinforce the flow of data through the application. He also answers a few additional audience questions.
Routing
Basic Routing
03:06:33 - 03:15:04
Basic Routing
Ryan helped develop React Router which is a complete routing library for React. He did this because he felt React was lacking many of the routing features he liked in Ember. Ryan first codes a routing example that doesn’t use any external libraries.
React Router
03:15:05 - 03:24:08
React Router
Ryan talks about why he created React Router. This library facilitates more complex routing scenarios like nested user interfaces or route cancellation. -
https://github.com/rackt/react-routerRouting Questions
03:24:09 - 03:38:09
Routing Questions
Ryan continues to answer audience questions about the routing capabilities of React Router. Some of the questions include server-side rendering, transitions, and life-cycles.
Exercise 6: Routing
03:38:10 - 03:38:36
Exercise 6: Routing
In this exercise, you will add a route to the “about” page above the new contact area.
Exercise 6: Solution
03:38:37 - 03:44:33
Exercise 6: Solution
Ryan demonstrates the solution to Exercise 6. He also shows a couple examples of using animations with routes.
Migrating to React
Adding React to an Existing App
03:44:34 - 03:54:15
Adding React to an Existing App
Since completely rewriting an application with a new technology can be a hard sell, Ryan demonstrates how to migrate an application to React. The first step is to begin replacing existing components with React components. In this example, the existing components are built using Backbone.js.
Migration Considerations
03:54:16 - 04:05:31
Migration Considerations
Ryan discusses a few things that can cause headaches when migrating to React. For example, since libraries like jQuery UI have components that manipulate the DOM. In this case, React may have issues referencing elements that have been added or removed. Wrapping a third-party component with a React component can make the migration easier.
Wrap Up
What’s Coming Next
04:05:32 - 04:15:22
What’s Coming Next
Ryan talks about the future of React. For example, instead of using mix-ins or the createClass method, you can declare a new application using the JavaScript class keyword and extend the React.Component class. He also talks about React Native.
Final Questions
04:15:23 - 04:28:35
Final Questions
Ryan concludes the course by answering a few final audience questions.
[/spoiler]
Файлы примеров: присутствуют
Формат видео: MP4
Видео: H264, 1920x1080, 16:9, 23.98 fps, avg 800 kb/s
Аудио: AAC, 48kHz, 201kbps, stereo
[spoiler="Скриншоты"]

[/spoiler]