Reactjs
React and Redux Training Overview
React is a JavaScript library for building web user interfaces and is one of the most wanted and loved web frameworks today. React makes it painless to create interactive UIs on top of web standards and is often used with the Redux library for managing the data or state in a React application.
In this React course, students gain hands-on experience with the latest version of React and the tools for developing React applications. Developers learn the skills they need to immediately use React and Redux in their applications using JavaScript/ECMAScript.
Note: This React class can also be taught using TypeScript.
Please see this quick course overview video including a demo of the hands-on coding students do in class to reinforce the concepts.
Location and Pricing
Accelebrate offers instructor-led enterprise training for groups of 3 or more online or at your site. Most Accelebrate classes can be flexibly scheduled for your group, including delivery in half-day segments across a week or set of weeks. To receive a customized proposal and price quote for private corporate training on-site or online, please contact us.
In addition, some Web Development courses are available as live, online classes for individuals.
Objectives
- Use a JavaScript package manager (either npm or Yarn)
- Quickly understand the new JavaScript language features, including classes, modules, and arrow functions
- Articulate what React is and why it is useful
- Explore the basic architecture of a React application
- Gain a deep understanding of JSX and the Virtual DOM
- Use React components to build interactive interfaces
- Implement React and Redux best practices
- Write unit tests for React using Jest and React Testing Library
- Create and validate forms using controlled components
- Make HTTP calls to read or change data
- Explore the common component architecture patterns
- Configure simple and complex routing
- Understand state management including when it is needed and the various alternatives
- Utilize Redux to manage the state of the application
- Use React and Redux together
Prerequisites
Outline
- npm
- What is Node.js?
- What is npm?
- Using npm
- npm Scripts
- Yarn
- Why Yarn?
- npm vs. Yarn
- Installation
- Using Yarn
- Setup (Babel)
- Classes
- Scope (var, let, const)
- Arrow Functions
- Modules
- Template Literals
- Default, Rest, Spread
- Default
- Rest
- Spread
- Destructuring
- Optional Parameters
- Object.assign()
- Object Initializer
- Create new Project
- Folder Structure
- Browser Support
- Styles and Assets
- Dependencies
- Why React?
- What it is?
- Why it is useful?
- Angular, React Compared
- Web application architectures
- Server-side web application architecture
- Single-page web application architecture
- React Architecture
- Hello World in JavaScript
- Hello World in React
- Replacing createElement
- Embedding Expressions
- Specifying Attributes
- Creating an Element
- Create a Function Component
- Rendering a Component
- Creating a Class Component
- Composing & Reuse
- Read-only
- String Literals vs. Expressions
- Function vs. Class Components
- Listening/Subscribing/Wiring to an Event
- In Vanilla JavaScript
- In React: Function Component
- In React: Class Component
- Binding
- Why Binding is Necessary?
- Class Method
- Arrow Function
- Passing Parameters
- Using Arrow Functions
- Using Bind
- Handling Events
- Using Arrow Functions
- Using Bind
- Synthetic Events
- Definition
- Why Hooks?
- No Breaking Changes
- Hooks API: useState, useEffect, useRef, useContext
- Rules of Hooks
- Definition
- State in Function Components
- useState Hook
- State in Class Components
- Mutating state with setState
- Using State Correctly
- Data Flows Down
- useEffect Hook
- What does useEffect do?
- Using useEffect
- useEffect Demo
- What are Lifecycle Methods
- Understanding Mounting
- Common vs. Less Common Methods
- Using Lifecycle Methods
- If, else
- Conditional Operator (?)
- Logical (&&) Operator
- In Vanilla JavaScript: for loop, array.forEach, array.map
- In React: using Elements, Components
- Why Keys are Needed
- Reuse
- Component Communication
- Design Patterns
- Container and Presentation Components
- Composition vs. Inheritance
- Controlled Components
- CReuse of Change Logic across Multiple Inputs
- CHandling Form Submission
- C Controlling Other Form Elements: select, textarea, number
- CValidation
- CUncontrolled Components
- Axios library
- Fetch API
- Using with React (HTTP GET)
- Refactoring for Reuse
- HTTP POST, PUT, DELETE
- Installation
- Basics
- Handling Not Found (404)
- Parameters (Url & Query)
- Nesting
- Building a React Application for Production
- Deploying a React Application
- Serving Apps with Client-Side Routing
- Customizing Environment Variables
- Background
- Definition
- Reuse of stateful logic
- When to use Context
- useContext Hook
- What is State?
- When do you need Redux?
- Alternatives to Redux
- Using Context for Shared State
- Server State: React Query, SWR, or GraphQL client
- What is Redux?
- What is State?
- Benefits Checklist
- Principles of Redux
- Core Concepts (Store, State, Reducers, Actions, Action Creators)
- Complementary Packages
- When do you need Redux?
- Basic Redux Example (includes time traveling)
- Gotchas/Tips
- Redux with React in Function Components
- useSelector and useDispatch Hooks
- Provider
- Example
- Redux with React in Class Components
- Higher-Order Components
- The connect function
- Writing mapState functions
- Writing mapDispatch Functions
- Example
- Overview
- Async Actions (Thunks)
- Installation
- Your First Thunk
- Full CRUD Example
- Tools (Jest, React Testing Library or Enzyme)
- Syntax
- Testing Vanilla JavaScript with Jest
- Mocking
- Mocking Modules
- Mocking Functions
- Debugging Tests
- Component Tests with React Testing Library
- Component Tests with Enzyme
- Shallow
- Full
- Snapshot
- Testing Redux Actions & Thunks, Reducers, HTTP
Training Materials
Software Requirements
- Google Chrome and/or Firefox
- Other modern browsers as desired
- IDE/development environment of your choice
- Other free software and lab files that Accelebrate would specify, including Node.js