


Hooks corresponding to the defined endpoints */ It is available via either of the two entry points below: import from React-specific entry point that automatically generates RTK Query is included within the installation of the core Redux Toolkit package. Although knowledge of Redux and RTK are not required to use RTK Query, you should explore all of the additional global store management capabilities they provide, as well as installing the Redux DevTools browser extension, which works flawlessly with RTK Query to traverse and replay a timeline of your request & cache behavior. RTK Query is built on top of the Redux Toolkit core for its implementation, using Redux internally for its architecture. It is intended to simplify common cases for loading data in a web application, eliminating the need to hand-write data fetching & caching logic yourself. It is purpose-built to solve the use case of data fetching and caching, supplying a compact, but powerful toolset to define an API interface layer for your app. RTK Query is provided as an optional addon within the package.

It's optional, but can eliminate the need to hand-write data fetching logic yourself. It's included in the package as a separate set of entry points. Redux Toolkit also includes a powerful data fetching and caching capability that we've dubbed "RTK Query". It does not address concepts like "reusable encapsulated Redux modules", folder or file structures, managing entity relationships in the store, and so on. We can't solve every use case, but in the spirit of create-react-app and apollo-boost, we can try to provide some tools that abstract over the setup process and handle the most common use cases, as well as include some useful utilities that will let the user simplify their application code.īecause of that, this package is deliberately limited in scope. "Redux requires too much boilerplate code"."I have to add a lot of packages to get Redux to do anything useful"."Configuring a Redux store is too complicated".It was originally created to help address three common concerns about Redux: The Redux Toolkit package is intended to be the standard way to write Redux logic. The UMD package can be used as a tag directly. Yarn add is also available as a precompiled UMD package that defines a window.RTK global variable. Redux Toolkit is available as a package on NPM for use with a module bundler or in a Node application: # NPM Or if you are a TypeScript user, use cra-template-redux-typescript, which is based on that template npx create-react-app my-app -template redux-typescript

npx create-react-app my-app -template redux The recommended way to start new apps with React and Redux Toolkit is by using the official Redux+JS template for Create React App, which takes advantage of React Redux's integration with React components. (Formerly known as "Redux Starter Kit") Installation Using Create React App The official, opinionated, batteries-included toolset for efficient Redux development
