react-db
Installation
SKILL.md
This skill builds on db-core. Read it first for collection setup, query builder, and mutation patterns.
TanStack DB — React
Setup
import { eq, not, useLiveQuery } from '@tanstack/react-db'
function TodoList() {
const { data: todos, isLoading } = useLiveQuery({
query: (q) =>
q
.from({ todo: todoCollection })
.where(({ todo }) => not(todo.completed))
.orderBy(({ todo }) => todo.created_at, 'asc'),
})
if (isLoading) return <div>Loading...</div>