Remove the Local Store
The app now reads from Convex (useQuery) and writes to Convex (useMutation). The TanStack Store and localStorage code are no longer used. Let’s clean them up.
Delete the Store
Delete the store file:
rm src/store/task-store.ts
rmdir src/store
Remove TanStack Store Dependencies
Uninstall the packages:
pnpm remove @tanstack/store @tanstack/react-store
Verify
Run the app. Everything should work as before: creating tasks, moving them between columns, deleting them. The only difference is where the data is stored: on Convex instead of in the browser’s localStorage.
If you open your browser’s DevTools and look at localStorage, you will see the old kanban-tasks key is still there from before the migration. It is harmless. The app no longer reads from it. You can clear it if you like.
What We Removed
The store file we deleted had:
- A
Tasktype with manually managedidandcreatedAtfields - A
createStorecall withloadTasks()to read from localStorage - A
subscribe()call to write to localStorage on every change - Four functions:
addTask,updateTask,moveTask,deleteTask
Convex replaced all of this:
- The
Tasktype is now generated from the schema (asDoc<"tasks">) _idand_creationTimeare provided automatically- The database is the single source of truth: no localStorage, no manual persistence
- The four functions now live on the server in
convex/tasks.ts
The component code barely changed. We swapped useStore for useQuery and store functions for useMutation. The UI stayed the same.
Checkpoint: Commit your progress.
git add .
git commit -m "kanban-10: Remove TanStack Store and localStorage"
git push