Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
State Management with React Query
State Management with React Query

State Management with React Query: Improve developer and user experience by mastering server state in React

eBook
€11.99 €17.99
Paperback
€22.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

State Management with React Query

What Is State and How Do We Manage It?

State is a mutable data source that can be used to store data in a React application and can change over time and be used to determine how your component renders.

This chapter will refresh your existing knowledge about state in the React ecosystem. We will review what it is and why it is needed, and understand how it helps you build React applications.

We’ll also review how you can manage state natively in React by using the useState hook, the useReducer hook, and React Context.

Finally, we’ll offer brief descriptions of the common state management solutions such as Redux, Zustand, and MobX and understand why they have been created and the main common concept they all share.

By the end of this chapter, you will have either learned or remembered everything about state necessary to proceed in this book. You will also notice a pattern in how state is managed between different state management solutions and meet or get reacquainted with a familiar term. Spoiler alert: it is global state.

In this chapter, we’ll be covering the following topics:

  • What is state in React?
  • Managing state in React
  • What do different state management libraries have in common?

Technical requirements

In this book, you are going to see some code snippets. If you want to try them out, you are going to need the following:

  • An integrated development environment (IDE) such as Visual Studio Code.
  • A web browser (Google Chrome, Firefox, or Edge).
  • Node.js. All the code in this book was written with the current LTS version installed (16.16.0).
  • A package manager (npm, Yarn, or pnpm).
  • A React project. If you don’t have one, you can create one with Create React App by running the following command in your terminal:
    npx create-react-app my-react-app

All the code examples for this chapter can be found on GitHub at https://github.com/PacktPublishing/State-management-with-React-Query/tree/feat/chapter_1.

What is state in React?

State is the heart of your React application.

I challenge you to try to build a React application without any type of state. You’d probably be able to do something, but you would soon conclude that props cannot do everything for you and get stuck.

As mentioned in the introduction, state is a mutable data source used to store your data.

State is mutable, which means that it can be changed over time. When a state variable changes, your React component will re-render to reflect any changes that the state causes to your UI.

Okay, now, you might be wondering, “What will I store in my state?” Well, the rule of thumb that I follow is that if your data fits into any of the following points, then it’s not state:

  • Props
  • Data that will always be the same
  • Data that can be derived from other state variables or props

Anything that doesn’t fit this list can be stored in state. This means things such as data you just fetched through a request, the light or dark mode option of a UI, and a list of errors that you got from filling a form in the UI are all examples of what can be state.

Let’s look at the following example:

const NotState = ({aList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10
  ]}) => {
  const value = "a constant value";
  const filteredList = aList.filter((item) => item % 2 ===
    0);
  return filteredList.map((item) =>
    <div key={item}>{item}</div>);
};

Here, we have a component called NotState. Let’s look at the values we have in there and use our rule of thumb.

The aList variable is a component prop. Since our component will receive this, it doesn’t need to be state.

Our value variable is assigned a string value. Since this value will always be constant, then it doesn’t need to be state.

Finally, the filteredList variable is something that can be derived from our aList prop; therefore, it doesn’t need to be state.

Now that you are familiar with the concept of state, let’s get our hands dirty and understand how can we manage it in React.

Managing state in React

Before diving into some examples, it is important to mention that in this book, all the examples shown are in a React version after 16.8. This is because React Hooks were introduced in this version. Hooks changed the way we write React code and allowed for the appearance of libraries such as React Query, so it makes sense that any examples shown leverage them.

What is React Query?

React Query is a protocol-agnostic collection of hooks for fetching, caching, and updating server state in React.

In this section, I’ll show you how React allows us to handle state in a component and what we should do if we need to share state between components.

Let’s consider the following scenario.

I want to build an application that allows me to count something. In this application, I want to be able to do the following:

  • See the current counter value
  • Increment my counter
  • Decrement my counter
  • Reset the counter

Let’s imagine that we have a React component called App:

const App = () => {
  ...
  return (
    <div className="App">
      <div>Counter: {count}</div>
      <div>
        <button onClick={increment}>+1</button>
        <button onClick={decrement}>-1</button>
        <button onClick={reset}>Reset</button>
      </div>
    </div>

This app provides the UI needed to handle our counter needs, such as a div that we should use to display our count and three buttons with an onClick event waiting for a callback function to perform each of the following actions needed.

We are just missing the heart of this component, which is the state. Natively, React gives us two ways to hold state in our applications: useState and useReducer.

Let’s start by looking at useState.

Managing state with useState

useState is a React Hook that allows you to hold a stateful value. When calling this hook, it will return the stateful value and a function to update it.

Let’s look at an example of how to leverage useState to build the counter application:

const App = () => {
  const [count, setCount] = useState(0);
  const increment = () => setCount((currentCount) =>
    currentCount + 1);
  const decrement = () => setCount((currentCount) =>
    currentCount - 1);
  const reset = () => setCount(0);
  return (
    <div className="App">
      <div>Counter: {count}</div>
      <div>
        <button onClick={increment}>+1</button>
        <button onClick={decrement}>-1</button>
        <button onClick={reset}>Reset</button>
      </div>
    </div>
  );
};

The preceding snippet leverages the useState hook to hold our counter state. When we first call useState, two things are done:

  • The state value is initiated as 0
  • The count state variable is destructured; then, the same is done to the state updater function, called setCount

After this, we declare functions where we use the state updater function, setCount, to either increment, decrement, or reset our state variable.

Finally, we assign our state variable to the respective UI section and pass the callbacks to our buttons’ onClick events.

With that, we have built a simple counter application. Our application will start rendering our count as 0. Every time we click on the buttons, it will execute the respective state update, re-render our application, and display the new count value.

useState is the answer most of the time when you need any state in your React applications. Just don’t forget to apply the “what will I store in my state?” rule of thumb before!

Now, let’s see an example of how to manage state and build the same counter application by using the useReducer hook.

Managing state with useReducer

useReducer is the preferred option when we have a more complex state. Before using the hook, we need to do some setup so that we have everything we need to send to our useReducer hook:

const initialState = { count: 0 };
const types = {
  INCREMENT: "increment",
  DECREMENT: "decrement",
  RESET: "reset",
};
const reducer = (state, action) => {
  switch (action) {
    case types.INCREMENT:
      return { count: state.count + 1 };
    case types.DECREMENT:
      return { count: state.count - 1 };
    case types.RESET:
      return { count: 0 };
    default:
      throw new Error("This type does not exist");
  }
};

In the preceding snippet, we created three things:

  • An initialState object. This object has a property count with 0 as its value.
  • A types object that describes all the action types we will support.
  • A reducer. This reducer is responsible for receiving our state and action. By matching that action with the expected type, we’ll be able to update the state.

Now that the setup is done, let’s create our counter:

const AppWithReducer = () => {
  const [state, dispatch] = useReducer(reducer,
    initialState);
  const increment = () => dispatch(types.INCREMENT);
  const decrement = () => dispatch(types.DECREMENT);
  const reset = () => dispatch(types.RESET);
  return (
    <div className="App">
      <div>Counter: {state.count}</div>
      <div>
        <button onClick={increment}>+1</button>
        <button onClick={decrement}>-1</button>
        <button onClick={reset}>Reset</button>
      </div>
    </div>
  );
};

The preceding snippet leverages the useReducer hook to hold our counter state. When we first call useReducer, three things are done:

  • We indicate to our hook what reducer should be used
  • We initialize our state with the initialState object
  • We destructure the state object and then the dispatch function, which allows us to dispatch an action from the useReducer hook

After this, we create the functions that will be responsible for calling the dispatch function with the expected action.

Finally, we assign our state variable to the respective UI section and pass the callbacks to our buttons’ onClick events.

With these two hooks under your belt, you now know how to manage state in your components.

Now, let’s picture the following scenario: what if you need your counter state to be accessible in other components?

You could pass them by props. But what if this state needs to be sent to five other components and different levels on the tree? Would you be prop-drilling it and passing it to every component?

To deal with this scenario and improve your code readability, React Context was created.

Sharing state with React Context

Context allows you to natively share values between components without having to prop drill them. Let’s learn how to build a context to handle our counter:

import { useState, createContext } from "react";
export const CountContext = createContext();
export const CountStore = () => {
  const [count, setCount] = useState(0);
  const increment = () => setCount((currentCount) =>
    currentCount + 1);
  const decrement = () => setCount((currentCount) =>
    currentCount - 1);
  const reset = () => setCount(0);
  return {
    count,
    increment,
    decrement,
    reset,
  };
};
const CountProvider = (children) => {
  return <CountContext.Provider value={CountStore()}
    {...children} />;
};
export default CountProvider;

In the preceding snippet, we are doing three things:

  • Using the createContext function to create our context.
  • Creating a store. This store will be responsible for holding our state. Here, you can see we leverage the useState hook. At the end of the store, we return an object that contains the functions to do the state updates and create our state variable.
  • Creating a CountProvider. This provider is responsible for creating a provider that will be used to wrap a component. This will allow every component that is inside of that provider to access our CountStore values.

Once this setup has been done, we need to make sure our components can access our context:

root.render(
  <CountProvider>
    <App />
  </CountProvider>
);

The preceding snippet leverages CountProvider, which we created in the previous snippet, to wrap up our App component. This allows every component inside App to consume our context:

import { CountContext } from "./CountContext/CountContext";
const AppWithContext = () => {
  const { count, increment, decrement, reset } =
    useContext(CountContext);
  return (
    <div className="App">
      <div>Counter: {count}</div>
      <div>
        <button onClick={increment}>+1</button>
        <button onClick={decrement}>-1</button>
        <button onClick={reset}>Reset</button>
      </div>
    </div>
  );
};

Finally, in this snippet, we leverage the useContext hook to consume our CountContext. Since our component is rendered inside our custom provider, we can access the state held inside our context.

Every time the state updates inside of our context, React will make sure that every component that is consuming our context will re-render, as well as receive the state updates. This can often lead to unnecessary re-renders because if you are consuming only a variable from the state and for some reason another variable changes, then the context will force all consumers to re-render.

One of the downsides of context is that often, unrelated logic tends to get grouped. As you can see from the preceding snippets, it comes at the cost of a bit of boilerplate code.

Now, Context is still great, and it’s how React enables you to share state between components. However, it was not always around, so the community had to come up with ideas on how to enable state sharing. To do so, state management libraries were created.

What do different state management libraries have in common?

One of the freedoms React offers you is that it does not impose any standards or practices for your development. While this is great, it also leads to different practices and implementations.

To make this easier and give developers some structure, state management libraries were created:

  • Redux promotes an approach focused on stores, reducers, and selectors. This leads to needing to learn specific concepts and filling your project with a bunch of boilerplate code that might impact the code’s readability and increase code complexity.
  • Zustand promotes a custom hook approach where each hook holds your state. This is by far the simplest solution and currently my favorite one. It synergizes with React and fully embraces hooks.
  • MobX doesn’t impose an architecture but focuses on a functional reactive approach. This leads to more specific concepts, and the diversity of practices can lead the developer to run into the same struggles of code structure that they might already suffer from with React.

One common thing in all these libraries is that all of them are trying to solve the same type of issues that we tried to solve with React Context: a way to manage our shared state.

The state that is accessible to multiple components inside a React tree is often called global state. Now, global state is often misunderstood, which leads to the addition of unnecessary complexity to your code and often needing to resort to the libraries mentioned in this section.

At the end of the day, each developer and team have their preferences and choices. Considering React gives you the freedom to handle your state however you want, you must consider all the advantages and disadvantages of each solution before making your choice. Migrating from one to another can take a lot of time and completely change the paradigm of how state is handled in your application, so choose wisely and take your time.

While global state is not the reason why React Query was built, it has an impact on its creation. The way global state is often composed led to the need to manage a specific part of it that has many challenges. This specific part is called server state and the way it was historically handled paved the way to motivate Tanner Linsley to create React Query.

Summary

In this chapter, we became familiar with the concept of state. By now, you should understand the importance of state as the heart of React applications and know how you can manage it natively with the help of useState and useReducer.

You learned that sometimes, you need to share your state with multiple components and that you can do it with Context or by leveraging a third-party state management library. Each of these solutions has its pros and cons, and at the end of the day, it will be a question of developer preference.

In Chapter 2, Server State versus Client State, you will understand more about global state, and you find out that often, our global state is a combination of both server and client state. You will learn what these terms mean, how to identify these states, and what the common challenges associated with them are.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn how state is split into server and client state and the common challenges with each
  • Understand how React Query addresses server state challenges by facilitating data fetching and mutations
  • Apply the knowledge gained to improve developer experience and build applications with improved UX

Description

State management, a crucial aspect of the React ecosystem, has gained significant attention in recent times. While React offers various libraries and tools to handle state, each with different approaches and perspectives, one thing is clear: state management solutions for handling client state are not optimized for dealing with server state. React Query was created to address this issue of managing your server state, and this guide will equip you with the knowledge and skills needed to effectively use React Query for state management. Starting with a brief history of state management in the React ecosystem, you’ll find out what prompted the split from a global state to client and server state and thus understand the need for React Query. As you progress through the chapters, you'll see how React Query enables you to perform server state tasks such as fetching, caching, updating, and synchronizing your data with the server. But that’s not all; once you’ve mastered React Query, you’ll be able to apply this knowledge to handle server state with server-side rendering frameworks as well. You’ll also work with patterns to test your code by leveraging the testing library and Mock Service Worker. By the end of this book, you'll have gained a new perspective of state and be able to leverage React Query to overcome the obstacles associated with server state.

Who is this book for?

The book is for React developers who want to improve their state management skills and overcome the hurdles brought about by server state while improving their developer and user experience. Basic knowledge of web development and React will assist with understanding key concepts covered in this book. JavaScript developers will also find it useful.

What you will learn

  • Learn about state and how it s often managed
  • Discover how state splits into server state and Client state
  • Solve common challenges with server state using React Query
  • Install and configure React Query and its Devtools
  • Manage server state data fetching by using the useQuery hook
  • Create, update and delete data by using the useMutation hook
  • Discover the use of React Query with frameworks like Next.js and Remix
  • Explore MSW and the Testing Library to test React Query using hooks

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 12, 2023
Length: 228 pages
Edition : 1st
Language : English
ISBN-13 : 9781803231341
Vendor :
Facebook
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : May 12, 2023
Length: 228 pages
Edition : 1st
Language : English
ISBN-13 : 9781803231341
Vendor :
Facebook
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 90.97
React 18 Design Patterns and Best Practices
€33.99
Learn React with TypeScript
€33.99
State Management with React Query
€22.99
Total 90.97 Stars icon

Table of Contents

13 Chapters
Part 1: Understanding State and Getting to Know React Query Chevron down icon Chevron up icon
Chapter 1: What Is State and How Do We Manage It? Chevron down icon Chevron up icon
Chapter 2: Server State versus Client State Chevron down icon Chevron up icon
Chapter 3: React Query – Introducing, Installing, and Configuring It Chevron down icon Chevron up icon
Part 2: Managing Server State with React Query Chevron down icon Chevron up icon
Chapter 4: Fetching Data with React Query Chevron down icon Chevron up icon
Chapter 5: More Data-Fetching Challenges Chevron down icon Chevron up icon
Chapter 6: Performing Data Mutations with React Query Chevron down icon Chevron up icon
Chapter 7: Server-Side Rendering with Next.js or Remix Chevron down icon Chevron up icon
Chapter 8: Testing React Query Hooks and Components Chevron down icon Chevron up icon
Chapter 9: What Changes in React Query v5? Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(5 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
M. Jun 26, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
1) Starts with the absolute basics and slowly accelerates until you're going full-speed and don't even realize it.2) Uses simple, logical examples that are easy to understand and reapply later.3) Doesn't linger on any topic too long, rather a steady pace is maintained it the entire way through.4) Any React dev who picks up this book is walking away at least one valuable addition to their box of tricks.
Amazon Verified review Amazon
William Kotheimer May 31, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
“State Management with React Query” starts with comparing useState, useReducer, and useContext for managing state. You don’t need know how React hooks work to understand this. He really does a great job both explaining these concepts, and showing how one would use them in an increment/decrement app. In doing this, he also lays the conceptual groundwork for understanding what React Query does for api state, i.e. taking over this aspect so that these other hooks can focus on app state. I thought he did a great job of explaining these “separation of concerns” before delving into fetching apis and using state with react query.I was surprised by the depth of this book. Even only 100 pages in, he already covered getting api data with either fetch or Axios library, and setup for caching data and using it, and invalidating cache after a POST request is made that triggers a refetch. This was a great way to show how much control React Query offers over when to allow data fetches to occur, even better than when useEffect was used to trigger apis calls on page load and populate useState. In addition, he shows using callbacks after a success, conditional enabling, cache time, and notifications.I’d recommend this book for anyone who desired an overview of React Query. It doesn’t use typescript but that’s the only thing that seems to be missing here. The second half of the book delves into using Remix and Next.js with React Query for server side rendering, and testing.If you’re looking for something to get started with React Query, definitely try the docs, but if you are looking for something more, “State Management with React Query” by Daniel Afonso is a great choice.
Amazon Verified review Amazon
Yevhenii Jun 19, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
"State Management with React Query" surpassed my expectations with its comprehensive and accessible approach. The author skillfully explained the nuances of useState, useReducer, and useContext, making them easily understandable even for beginners. The book seamlessly integrated these state management techniques into an increment/decrement app, while also laying the groundwork for comprehending React Query's role in API state management. Furthermore, it covered essential topics such as fetching API data, caching, invalidation, and advanced features like callbacks and conditional enabling. Despite the lack of TypeScript implementation, I highly recommend this book as a valuable resource for anyone looking to gain a thorough understanding of React Query and its practical applications.
Amazon Verified review Amazon
CP MB Jun 02, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
From the beginning, I realized this book could be an excellent book, and in the end, it didn't disappoint. The author took the time to explain in detail the most popular current approaches to application state management and later explained why his approach is better, which I agree with. This book is well thought out and it feels like there was a significant amount of planning done by the author before writing the first chapter. If you want to implement application state the right way, read this book!
Amazon Verified review Amazon
Tudor Jun 06, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I really like the book, it's smooth to read, and I like how the information is presented and how the author adds React specific explanations to help the readers refresh their knowledge and better understand a topic.From the start it doesn't rush things it sets the stage and shows the pain points so you better understand why you need React Query.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.