You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/introduction/GettingStarted.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ You can use Redux together with [React](https://reactjs.org), or with any other
17
17
18
18
### Redux Toolkit
19
19
20
-
[**Redux Toolkit**](https://redux-toolkit.js.org) is our official recommended approach for writing Redux logic. It wraps around the Redux core, and contains packages and functions that we think are essential for building a Redux app. Redux Toolkit builds in our suggested best practices, simplifies most Redux tasks, prevents common mistakes, and makes it easier to write Redux applications.
20
+
[**Redux Toolkit**](https://redux-toolkit.js.org) is our official standard approach for writing Redux logic. It wraps around the Redux core, and contains packages and functions that we think are essential for building a Redux app. Redux Toolkit builds in our suggested best practices, simplifies most Redux tasks, prevents common mistakes, and makes it easier to write Redux applications.
21
21
22
22
RTK includes utilities that help simplify many common use cases, including [store setup](https://redux-toolkit.js.org/api/configureStore),
23
23
[creating reducers and writing immutable update logic](https://redux-toolkit.js.org/api/createreducer),
@@ -39,16 +39,24 @@ yarn add @reduxjs/toolkit
39
39
40
40
### Create a React Redux App
41
41
42
-
The recommended way to start new apps with React and Redux is by using the [official Redux+JS template](https://github.com/reduxjs/cra-template-redux) or [Redux+TS template](https://github.com/reduxjs/cra-template-redux-typescript) for [Create React App](https://github.com/facebook/create-react-app), which takes advantage of **[Redux Toolkit](https://redux-toolkit.js.org/)** and React Redux's integration with React components.
42
+
The recommended way to start new apps with React and Redux is by using [our official Redux+TS template for Vite](https://github.com/reduxjs/redux-templates), or by creating a new Next.js project using [Next's `with-redux` template](https://github.com/vercel/next.js/tree/canary/examples/with-redux).
43
+
44
+
Both of these already have Redux Toolkit and React-Redux configured appropriately for that build tool, and come with a small example app that demonstrates how to use several of Redux Toolkit's features.
43
45
44
46
```bash
45
-
# Redux + Plain JS template
46
-
npx create-react-app my-app --template redux
47
+
# Vite with our Redux+TS template
48
+
# (using the `degit` tool to clone and extract the template)
Copy file name to clipboardExpand all lines: docs/introduction/Installation.md
+39-22Lines changed: 39 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,45 +22,62 @@ yarn add @reduxjs/toolkit
22
22
23
23
It's also available as a UMD build, which can be loaded from [the `dist` folder on unpkg](https://unpkg.com/@reduxjs/toolkit/dist/). The UMD builds make Redux Toolkit available as a `window.RTK` global variable.
24
24
25
-
## Redux Core
25
+
## Complementary Packages
26
26
27
-
To install the stable version:
27
+
### React-Redux
28
28
29
-
```bash
30
-
# NPM
31
-
npm install redux
29
+
Most likely, you'll also need [the `react-redux` bindings for use with React](https://github.com/reduxjs/react-redux)
32
30
33
-
# Yarn
34
-
yarn add redux
31
+
```bash
32
+
npm install react-redux
35
33
```
36
34
37
-
If you're not, you can [access these files on unpkg](https://unpkg.com/redux/), download them, or point your package manager to them.
35
+
Note that unlike Redux itself, many packages in the Redux ecosystem don't provide UMD builds, so we recommend using module bundlers like [Vite](https://vitejs.dev/) and [Webpack](https://webpack.js.org/) for the most comfortable development experience.
38
36
39
-
Most commonly, people consume Redux as a collection of [CommonJS](http://www.commonjs.org/) modules. These modules are what you get when you import `redux` in a [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/), or a Node environment. If you like to live on the edge and use [Rollup](https://rollupjs.org), we support that as well.
37
+
### Redux DevTools Extension
40
38
41
-
If you don't use a module bundler, it's also fine. The `redux` npm package includes precompiled production and development [UMD](https://github.com/umdjs/umd) builds in the [`dist` folder](https://unpkg.com/redux/dist/). They can be used directly without a bundler and are thus compatible with many popular JavaScript module loaders and environments. For example, you can drop a UMD build as a [`<script>` tag](https://unpkg.com/redux/dist/redux.js) on the page, or [tell Bower to install it](https://github.com/reduxjs/redux/pull/1181#issuecomment-167361975). The UMD builds make Redux available as a `window.Redux` global variable.
39
+
Redux Toolkit's `configureStore` automatically sets up integration with the pRedux DevTools](https://github.com/reduxjs/redux-devtools/tree/main/extension). You'll want to install the browser extensions to view the store state and actions:
42
40
43
-
The Redux source code is written in ES2015 but we precompile both CommonJS and UMD builds to ES5 so they work in [any modern browser](https://caniuse.com/#feat=es5). You don't need to use Babel or a module bundler to [get started with Redux](https://redux.js.org/introduction/examples#counter-vanilla).
41
+
- Redux DevTools Extension:
42
+
-[Redux DevTools Extension for Chrome](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en)
43
+
-[Redux DevTools Extension for Firefox](https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/)
44
44
45
-
## Complementary Packages
45
+
If you're using React, you'll want the React DevTools extension as well:
46
+
47
+
- React DevTools Extension:
48
+
-[React DevTools Extension for Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
49
+
-[React DevTools Extension for Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/)
50
+
51
+
## Create a React Redux App
52
+
53
+
The recommended way to start new apps with React and Redux is by using [our official Redux+TS template for Vite](https://github.com/reduxjs/redux-templates), or by creating a new Next.js project using [Next's `with-redux` template](https://github.com/vercel/next.js/tree/canary/examples/with-redux).
46
54
47
-
Most likely, you'll also need [the React bindings](https://github.com/reduxjs/react-redux)and [the developer tools](https://github.com/reduxjs/redux-devtools).
55
+
Both of these already have Redux Toolkit and React-Redux configured appropriately for that build tool, and come with a small example app that demonstrates how to use several of Redux Toolkit's features.
48
56
49
57
```bash
50
-
npm install react-redux
51
-
npm install --save-dev @redux-devtools/core
58
+
# Vite with our Redux+TS template
59
+
# (using the `degit` tool to clone and extract the template)
Note that unlike Redux itself, many packages in the Redux ecosystem don't provide UMD builds, so we recommend using CommonJS module bundlers like [Webpack](https://webpack.js.org/) and [Browserify](http://browserify.org/)for the most comfortable development experience.
66
+
We do not currently have official React Native templates, but recommend these templates for standard React Native and for Expo:
The recommended way to start new apps with React and Redux is by using the [official Redux+JS template](https://github.com/reduxjs/cra-template-redux) or [Redux+TS template](https://github.com/reduxjs/cra-template-redux-typescript) for [Create React App](https://github.com/facebook/create-react-app), which takes advantage of **[Redux Toolkit](https://redux-toolkit.js.org/)** and React Redux's integration with React components.
Copy file name to clipboardExpand all lines: docs/tutorials/essentials/part-3-data-flow.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ If you'd like to see the final version of what we're going to build, you can che
55
55
56
56
#### Creating a New Redux + React Project
57
57
58
-
Once you've finished this tutorial, you'll probably want to try working on your own projects. **We recommend using the [Redux templates for Create-React-App](https://github.com/reduxjs/cra-template-redux) as the fastest way to create a new Redux + React project**. It comes with Redux Toolkit and React-Redux already configured, using [the same "counter" app example you saw in Part 1](./part-1-overview-concepts.md). This lets you jump right into writing your actual application code without having to add the Redux packages and set up the store.
58
+
Once you've finished this tutorial, you'll probably want to try working on your own projects. **We recommend using the [Redux template for Vite](../../introduction/Installation.md#create-a-react-redux-app) as the fastest way to create a new Redux + React project**. It comes with Redux Toolkit and React-Redux already configured, using [the same "counter" app example you saw in Part 1](./part-1-overview-concepts.md). This lets you jump right into writing your actual application code without having to add the Redux packages and set up the store.
59
59
60
60
If you want to know specific details on how to add Redux to a project, see this explanation:
0 commit comments