![]() ![]() ![]() It's a trade-off between short term and long term productivity. It also adds some indirection to your code, and asks you to follow certain restrictions. There are more concepts to learn, and more code to write. Redux helps you deal with shared state management, but like any tool, it has tradeoffs. Redux guides you towards writing code that is predictable and testable, which helps give you confidence that your application will work as expected. The patterns and tools provided by Redux make it easier to understand when, where, why, and how the state in your application is being updated, and how your application logic will behave when those changes occur. Redux helps you manage "global" state - state that is needed across many parts of your application. It serves as a centralized store for state that needs to be used across your entire application, with rules ensuring that the state can only be updated in a predictable fashion. Redux is a pattern and library for managing and updating application state, using events called "actions". What does it do? What problems does it help me solve? Why would I want to use it? It helps to understand what this "Redux" thing is in the first place. We'll be here when you're ready!įinally, you should make sure that you have the React and Redux DevTools extensions installed in your browser: If you're not already comfortable with those topics, we encourage you to take some time to become comfortable with them first, and then come back to learn about Redux. Knowledge of asynchronous JavaScript and making AJAX requests.Knowledge of React terminology: JSX, State, Function Components, Props, and Hooks.Understanding of the array and object spread operators.Familiarity with ES6 syntax and features.We've tried to keep these explanations beginner-friendly, but we do need to make some assumptions about what you know already so that we can focus on explaining Redux itself. Once you understand the core concepts covered here, you'll understand how to use Redux Toolkit more efficiently. Redux Toolkit is the recommended way to build production apps with Redux, and is built on all of the concepts that we will look at throughout this tutorial. Once you understand how everything fits together, we'll look at using Redux Toolkit to simplify things. Redux Fundamentals, Part 8: Modern Redux with Redux Toolkit, which shows how to convert the low-level examples from earlier sections into modern Redux Toolkit equivalents.We recommend that all Redux learners should read the "Essentials" tutorial! The full "Redux Essentials" tutorial, which teaches "how to use Redux, the right way" with Redux Toolkit for real-world apps.See these pages to learn how to use "modern Redux" with Redux Toolkit: ![]() It's not meant to be a production-ready project. Note that this tutorial intentionally shows older-style Redux logic patterns that require more code than the "modern Redux" patterns with Redux Toolkit we teach as the right approach for building apps with Redux today, in order to explain the principles and concepts behind Redux. This tutorial will teach you "how Redux works", as well as why these patterns exist. Finally, we'll see how these lower-level examples translate into the higher-level patterns that we recommend for actual usage in real applications. After we finish building the working example app "by hand" so that you can see exactly what's happening, we'll talk about some of the standard patterns and abstractions typically used with Redux. Starting in Part 3: State, Actions, and Reducers, we'll use that knowledge to build a small example app that demonstrates how these pieces fit together and talk about how Redux works in practice. In Part 1 of this tutorial, we'll briefly look at a minimal example of a working Redux app to see what the pieces are, and in Part 2: Redux Concepts and Data Flow we'll look at those pieces in more detail and how data flows in a Redux application. By the time you finish, you should understand the different pieces that make up a Redux app, how data flows when using Redux, and our standard recommended patterns for building Redux apps. Welcome to the Redux Fundamentals tutorial! This tutorial will introduce you to the core concepts, principles, and patterns for using Redux. The basic pieces that make up a Redux app.What Redux is and why you might want to use it. ![]()
0 Comments
Leave a Reply. |