Beginning React

Book description

Take your web applications to a whole new level with efficient, component-based UIs that deliver cutting-edge interactivity and performance.

Key Features

  • Elaborately explains basics before introducing advanced topics
  • Explains creating and managing the state of components across applications
  • Implement over 15 practical activities and exercises across 11 topics to reinforce your learning

Book Description

Projects like Angular and React are rapidly changing how development teams build and deploy web applications to production. In this book, you'll learn the basics you need to get up and running with React and tackle real-world projects and challenges. It includes helpful guidance on how to consider key user requirements within the development process, and also shows you how to work with advanced concepts such as state management, data-binding, routing, and the popular component markup that is JSX. As you complete the included examples, you'll find yourself well-equipped to move onto a real-world personal or professional frontend project.

What you will learn

  • Understand how React works within a wider application stack
  • Analyze how you can break down a standard interface into specific components
  • Successfully create your own increasingly complex React components with HTML or JSX
  • Correctly handle multiple user events and their impact on overall application state
  • Understand the component lifecycle to optimize the UX of your application
  • Configure routing to allow effortless, intuitive navigation through your components

Who this book is for

If you are a frontend developer who wants to create truly reactive user interfaces in JavaScript, then this is the book for you. For React, you'll need a solid foundation in the essentials of the JavaScript language, including new OOP features that were introduced in ES2015. An understanding of HTML and CSS is assumed, and a basic knowledge of Node.js will be useful in the context of managing a development workflow, but is not essential.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Beginning React
  3. Packt Upsell
    1. Why Subscribe?
    2. PacktPub.com
  4. Contributors
    1. About the Author
    2. About the Reviewer
    3. Packt Is Searching for Authors like You
  5. Preface
    1. Who This Book Is For
    2. What This Book Covers
    3. To Get the Most out of This Book
      1. Download the Example Code Files
      2. Download the Color Images
      3. Conventions Used
    4. Get in Touch
      1. Reviews
  6. Introducing React and UI Design
    1. What is React?
    2. How to Set up a React-Based Application
      1. Installing create-react-app
      2. Creating Your First React Application
        1. Activity: Creating an Application with create-react-app
      3. Exploring the Generated Content
      4. The create-react-app Commands
        1. The npm start Command
          1. Changing File Content and Viewing the Result
          2. Activity: Starting and Changing the Application
        2. The npm test Command
        3. The npm run build Command
        4. The npm run eject Command
    3. How to Design a UI
      1. Everything Is a Component
      2. Decompose a User Interface
      3. Container and Presentational Components
        1. Activity: Detecting Components in a Web User Interface
    4. Summary
  7. Creating Components
    1. Definition of a Component
      1. Building Our First React Component
      2. Managing Styles
        1. Adding CSS
      3. Activity: Defining a Shopping Cart
    2. Using JSX
      1. Activity: Translating HTML into JSX
    3. Composing Components
      1. Combining Components
      2. Activity: Defining a Composed Cart
    4. Data Propagation
      1. Activity: Creating a Cart Item Component
    5. Managing the Internal State
      1. Activity: Adding State Management to the Cart Component
    6. Summary
  8. Managing User Interactivity
    1. Managing User Interaction
      1. HTML Events versus React Events
      2. Event Handlers and the this Keyword
      3. Changing the State
      4. Activity: Adding Items to the Shopping Cart
    2. Component Lifecycle Events
      1. Activity: Showing the Quantity of Items Added to the Cart
    3. Managing Routing
      1. Installing React Router
        1. Using the Router
        2. Defining Views
      2. Some Notes About the Route Component
      3. Nested Views
      4. Path Parameters
      5. Activity: Adding a View About Shipping Methods
    4. Summary
  9. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Beginning React
  • Author(s): Andrea Chiarelli
  • Release date: July 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781789530520