09f235d9be
I was updating one of my old next.js v3 apps to v13, and decided to play around with RTK. Using the with-redux example sort of sets users up for some weird typing issues as mentioned here: https://github.com/reduxjs/redux-toolkit/issues/2862 I found that github issue _after_ reading through all the official RTK x TS docs, and it seems it could have all been avoided with stricter typing. I'm hoping RTK can add this bit to their docs soon. |
||
---|---|---|
.. | ||
public | ||
src | ||
.gitignore | ||
jest.config.ts | ||
package.json | ||
README.md | ||
setupTests.ts | ||
tsconfig.json | ||
tsconfig.test.json |
Redux Toolkit TypeScript Example
This example shows how to integrate Next.js with Redux Toolkit.
The Redux Toolkit is a standardized 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:
How to use
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example with-redux with-redux-app
yarn create next-app --example with-redux with-redux-app
pnpm create next-app --example with-redux with-redux-app
Deploy it to the cloud with Vercel (Documentation).