Long-board使用Redux Toolkit和TypeScript的Next.js项目模板

Redux Toolkit 加 TypeScript 的组合,在 Next.js 里用起来还挺顺的。long-board这个项目就整合得蛮干净的,目录清晰,代码也不复杂,初学 Redux 或者搞 TS 项目结构的可以看看。

store 的配置挺标准的,直接用configureStore,中间件像redux-devtools这些都默认带上了,省事。关键是这个例子也用到了createSlice,写 reducer 和 action 就方便多了。

用 Next.js也自然,服务端渲染也能配合得上,页面跳转响应快,不用自己手动什么异步注水。部署也简单,你可以用npx create-next-app --example with-redux-toolkit-typescript这个命令一键拉下来。

如果你是想上手一个靠谱的 Next + Redux + TypeScript 项目结构,或者想给团队搭个模版,这个项目还蛮适合参考的。别忘了看一下相关资源,比如react-redux-typescript-guide这个,讲得挺细的。

zip
long-board-main.zip 预估大小:37个文件
folder
long-board-main 文件夹
file
.gitignore 386B
folder
components 文件夹
file
add-note.tsx 1KB
file
counter.tsx 4KB
file
Layout.tsx 974B
file
edit-note.tsx 1KB
file
clock.tsx 740B
file
package.json 689B
file
package-lock.json 99KB
folder
src 文件夹
file
store.ts 477B
file
tsconfig.json 649B
folder
db_with-redux-toolkit 文件夹
folder
a2b2-c2d3 文件夹
file
LOG 1KB
file
manifest.json 27B
folder
_ttl 文件夹
folder
LOG 文件夹
file
manifest.json 27B
folder
_ai_store 文件夹
folder
LOG 文件夹
file
manifest.json 27B
folder
_util 文件夹
file
LOG 2KB
file
manifest.json 27B
folder
types 文件夹
file
Note.ts 110B
file
Test.ts 66B
file
ErrorResponse.ts 229B
file
README.md 1KB
file
next-env.d.ts 75B
folder
lib 文件夹
file
useInterval.ts 546B
file
useForm.ts 626B
folder
slices 文件夹
file
counterSlice.ts 2KB
file
clockSlice.ts 626B
file
notesSlice.ts 5KB
folder
styles 文件夹
file
common.scss 176B
file
layout.module.scss 66B
file
index.scss 3KB
folder
pages 文件夹
folder
api 文件夹
file
notes.js 3KB
file
login.tsx 691B
file
test.tsx 230B
file
index.tsx 604B
file
_app.tsx 440B
file
notes.tsx 2KB
zip 文件大小:50KB