Skip to content

Commit

Permalink
Reorder installation sections and add to readme for consistency (#433)
Browse files Browse the repository at this point in the history
* Move template up in installation instructions

Ported from recent changes in reduxjs/react-redux#1543

* Fix heading levels for accessibility

* Don't assume React is used in installation

* Add installation to readme
  • Loading branch information
nickserv authored Mar 14, 2020
1 parent 84483e6 commit de26824
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,34 @@

**The official, opinionated, batteries-included toolset for efficient Redux development**

`npm install @reduxjs/toolkit`

(Formerly known as "Redux Starter Kit")

### Purpose
## Installation

### Using Create React App

The recommended way to start new apps with React and Redux Toolkit is by using the [official Redux+JS template](https://github.com/reduxjs/cra-template-redux) for [Create React App](https://github.com/facebook/create-react-app), which takes advantage of React Redux's integration with React components.

```sh
npx create-react-app my-app --template redux
```

### An Existing App

Redux Toolkit is available as a package on NPM for use with a module bundler or in a Node application:

```bash
# NPM
npm install @reduxjs/toolkit

# Yarn
yarn add @reduxjs/toolkit
```

It is also available as a precompiled UMD package that defines a `window.RTK` global variable.
The UMD package can be used as a [`<script>` tag](https://unpkg.com/@reduxjs/toolkit/dist/redux-toolkit.umd.js) directly.

## Purpose

The **Redux Toolkit** package is intended to be the standard way to write Redux logic. It was originally created to help address three common concerns about Redux:

Expand All @@ -23,7 +46,7 @@ We can't solve every use case, but in the spirit of [`create-react-app`](https:/

This package is _not_ intended to solve every possible use case for Redux, and is deliberately limited in scope. It does _not_ address concepts like "reusable encapsulated Redux modules", data fetching, folder or file structures, managing entity relationships in the store, and so on.

### What's Included
## What's Included

Redux Toolkit includes:

Expand Down
18 changes: 10 additions & 8 deletions docs/introduction/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ Redux Toolkit includes:

## Installation

### Using Create React App

The recommended way to start new apps with React and Redux Toolkit is by using the [official Redux+JS template](https://github.com/reduxjs/cra-template-redux) for [Create React App](https://github.com/facebook/create-react-app), which takes advantage of React Redux's integration with React components.

```sh
npx create-react-app my-app --template redux
```

### An Existing App

Redux Toolkit is available as a package on NPM for use with a module bundler or in a Node application:

```bash
Expand All @@ -48,14 +58,6 @@ yarn add @reduxjs/toolkit
It is also available as a precompiled UMD package that defines a `window.RTK` global variable.
The UMD package can be used as a [`<script>` tag](https://unpkg.com/@reduxjs/toolkit/dist/redux-toolkit.umd.js) directly.

## Create a React Redux App

The recommended way to start new apps with React and Redux Toolkit is by using the [official Redux+JS template](https://github.com/reduxjs/cra-template-redux) for [Create React App](https://github.com/facebook/create-react-app), which takes advantage of React Redux's integration with React components.

```sh
npx create-react-app my-app --template redux
```

## Help and Discussion

The **[#redux channel](https://discord.gg/0ZcbPKXt5bZ6au5t)** of the **[Reactiflux Discord community](http://www.reactiflux.com)** is our official resource for all questions related to learning and using Redux. Reactiflux is a great place to hang out, ask questions, and learn - come join us!
Expand Down

0 comments on commit de26824

Please sign in to comment.