Description
In this class, students learn the fundamental ideas behind React and TypeScript and then quickly move on to hands-on problem-solving and some of the most advanced and up-to-date techniques and tools in React development using TypeScript. The course teaches just enough about testing and tools for students to be productive but is primarily focused on hands-on exercises in which students will build a real-world e-commerce shopping cart application.
TARGET AUDIENCE
This course is designed for experienced professional developers (in any language) who want to learn how to quickly become productive with the latest version of React.ABOUT THE AUTHORChris Minnick has been a full-stack developer for over 25 years, and a professional author and trainer for 15 years. He has been the lead front-end React developer for several startup companies and has been building web and mobile user interfaces with React since 2015. Chris has produced online video courses for Pluralsight and O’Reilly Media and is the author of JavaScript All-In-One For Dummies and Beginning React JS Foundations.
OBJECTIVES
All students will:
- Get started quickly with React
- Learn to write unit tests for React using Jest
- Understand what React is and what problem it solves
- Explore the basic architecture of a React application
- Gain a deep knowledge of React components and JSX
- Build a working application that uses React components
- Learn about the Hooks API
- Use Redux for maintaining state in a React.js application
- Use the Context API to pass data in a component tree
- Use Redux middleware
- Make AJAX requests with React
- Use server-side rendering
- Learn React best practices
DURATION
This course can be taught as a 3-day course or a 5-day course. The 3-day version has reduced Redux, JavaScript, and Testing coverage.
OUTLINE
- Introduction
- What is React?
- What is React not?
- What can you use React for?
- React Quick Start
- Test and Run a React App
- Lab 01: Get Started with a React toolkit
- Introduction to ReactJS
- Explore the Virtual DOM
- React Philosophy
- Understanding Components
- Composition vs. Inheritance
- React is Idiomatic
- Lab 02: Your First Component
- How React Works
- Virtual DOM
- State Machines
- React.render()
- Lab 03: Writing tests and more components
- ReactDOM
- Other Rendering Engines
- React Native
- ReactDOMServer
- React Konsul
- react-pdf
- Advanced JavaScript
- Use arrow functions and block-scoped variables
- Use classes and modules
- Variable Scoping with const and let
- Arrow Functions
- Rest Parameter
- Template Literals
- Enhanced Object Properties
- Method notation in
object property definitions - Array Matching
- Object Matching
- For-Of Operator
- Class Definition
- Class Inheritance
- Understanding this
- Array.map()
- Array.filter()
- Array.reduce()
- Promises
- Async / Await
- Modularity
- Why is Modularity Important?
- CommonJS
- ES Modules
- The Document Object Model
- What is the DOM?
- Understanding Nodes
- EventTarget
- DOM Events
- Manipulating HTML with the DOM
- Manipulating HTML with JQuery
- Manipulating HTML with React
- Lab 4: DOM Manipulations and Modern JS
- Using JSX
- What is JSX?
- Children in JSX
- Using Literal JavaScript in JSX
- Using React with JSX
- Conditional Rendering with Element Variables
- Conditional Rendering with the && Logical Operator
- Conditional Rendering with the Conditional Operator
- React.Fragment
- Props
- React Development Process
- Creating a Component Hierarchy
- Goals of a Static Version
- Lab 5: Creating a Static UI
- React Components
- What are components?
- Single Responsibility
- Pure Functions
- super()
- React.PureComponent
- Function Components
- Component Children
- Styles in React
- Inline Styles
- Style Objects
- Style Modules
- CSS-in-JS
- Styled Components
- Lab 06: Styling React
- React Data Flow
- One-way Data Flow
- props vs state
- Lab 07: Props and Containers
- State
- What is State?
- How State Affects render()
- How to Know if it Should Be State
- Props vs. State
- Setting Initial State
- Updating State
- setState
- useState setter function
- What to Put in State
- Where Should Your State Live?
- Context API
- Lab 08: Adding State
- Events
- SyntheticEvent
- Event Listener Attributes
- The Event Object
- Binding Event Handlers
- Passing Data to Event Handlers
- Important Event Properties
- Forms
- What is “Inverse Data Flow”?
- Properties of Form components
- Form Events
- Controlled Inputs
- Uncontrolled Inputs
- Preventing Default Actions
- Form validation
- Using refs
- When to Use Refs
- Lab 09: Interactions, Events, Callbacks
- Component Life-Cycle Events
- Life-Cycle Methods
- Mount/Unmount
- Data Life-Cycle Methods
- Implementing error boundaries
- AJAX
- Fetch vs. Axios
- AJAX in class components
- AJAX in function components
- Fetch vs. Axios
- Suspense
- Working with CORS
- Lab 10: Component Life-Cycle and AJAX
- Hooks
- What are Hooks?
- Built-in Hooks
- useState
- useEffect
- Rules of Hooks
- useContext
- useReducer
- useCallback
- useMemo
- useRef
- useImperativeHandle
- useLayoutEffect
- useDebugValue
- Custom Hooks
- Why Use Custom Hooks
- Making Custom Hooks
- Lab 11: Converting a Class Component to a Function Component
- PropTypes
- Using PropTypes
- Default Props
- Lab 12: PropTypes and Default Props
- React with TypeScript
- TypeScript basics
- Why TypeScript?
- Type inference
- Union types
- Type aliases
- Interfaces
- Lab 13: Converting to TypeScript
- React Patterns and Best Practices
- Single Responsibility
- Composition
- Container Components
- Presentational Components
- Pure components
- React.memo
- Higher Order Functions
- Higher Order Components
- Render Props
- Reusable Components
- Communication Between Components
- Test-Driven Development
- Goal of TDD
- The TDD Cycle
- TDD Steps
- Assertions
- Assertion Libraries
- Jest
- Jest Overview
- Write test suites
- Create specs
- Use matchers
- How Jest Works
- Mocking
- Manual Mock
- Automocking
- Snapshot Testing
- Lab 14: Testing with React Testing Library
- Flux and Redux
- Flux Flow
- Redux
- Stores & Immutable State Tree
- Redux Actions
- Reducers
- Reducer Composition
- Reducer Composition Example
- Higher Order Reducer
- Redux Store
- Redux Store Design
- Benefits of Normalizing Store
- Redux Pros and Cons
- Lab 15: Implementing Redux with Redux Toolkit
- What is Redux Middleware?
- React AJAX Best Practices
- Redux Middleware
- Using React with Other Libraries
- Redux Thunk
- Lab 16: Redux Thunk
- Lab 17: Persisting Data in localStorage with Redux
- Routing
- React Router
- Using React Router
- Router Rendering Example
- Route Matching
- Lab 18: React Router
- Deploying React
- Development vs. Production
- Optimization Techniques
- Building Your Project
- Deploying React
- Render Caching
- Advanced Topics
- Relay and GraphQL
- Micro Frontends
- Shared State in React Micro Frontends
- Bonus Lab: Converting an App to a Micro Frontend