rsnext/examples/with-redux-toolkit
Luc Leray f52955ec94
Clean up examples package.json (#27121)
Clean up package.json files in the `examples` directory:
- Add `private: true`
- Remove `version` (because they are irrelevant for packages that are not meant to be published)
- Remove `name` (because they are optional for packages that are not meant to be published, and when someone clones an example, they often rename it and the property becomes stale)
- Remove `author`
- Remove `description`
- Remove `license`

Also remove `with-dynamic-app-layout` example completely, since it does the same as `layout-component` (https://github.com/vercel/next.js/pull/27121#discussion_r668178408).

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-12 19:58:03 +00:00
..
public Simplify redux toolkit example and update packages (#23047) 2021-03-16 20:15:54 +00:00
src Simplify redux toolkit example and update packages (#23047) 2021-03-16 20:15:54 +00:00
.gitignore Added .gitignore to examples that are deployed to vercel (#15127) 2020-07-16 10:52:23 -04:00
package.json Clean up examples package.json (#27121) 2021-07-12 19:58:03 +00:00
README.md Fix broken link (#23230) 2021-03-19 20:58:22 +00:00

Redux Toolkit example

This example shows how to integrate Next.js with Redux Toolkit.

The Redux Toolkit is intended to be the standard way to write Redux logic (create actions and reducers, setup the store with some default middlewares like redux devtools extension). This example demonstrates each of these features with Next.js

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example with-redux-toolkit with-redux-toolkit-app
# or
yarn create next-app --example with-redux-toolkit with-redux-toolkit-app

Deploy it to the cloud with Vercel (Documentation).

TypeScript Setup (optional)

If you haven't already added TypeScript to your project, follow the steps in the Next.js documentation. If you are new to TypeScript, go through the Next.js learning lesson on TypeScript.

Once TypeScript is added, follow the instructions given on the Redux Toolkit documentation to set up and use Redux Toolkit and React-Redux with TypeScript