create-huenei-template 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/templates.js +7 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/dist/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/dist/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/dist/templates/frontend/react-ssr/.dockerignore +14 -0
- package/dist/templates/frontend/react-ssr/.env.example +9 -0
- package/dist/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/dist/templates/frontend/react-ssr/Dockerfile +41 -0
- package/dist/templates/frontend/react-ssr/README.md +121 -0
- package/dist/templates/frontend/react-ssr/components.json +22 -0
- package/dist/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/dist/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/dist/templates/frontend/react-ssr/next.config.ts +7 -0
- package/dist/templates/frontend/react-ssr/package.json +86 -0
- package/dist/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/dist/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/dist/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/dist/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/dist/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/dist/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/dist/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/dist/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/dist/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/dist/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/dist/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/dist/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/dist/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/dist/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/dist/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/dist/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/dist/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/dist/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/dist/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/dist/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/dist/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/dist/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/dist/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/dist/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/dist/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/dist/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/dist/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/dist/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/dist/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/dist/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/dist/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/dist/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/dist/templates/frontend/react-ssr/vitest.config.ts +41 -0
- package/package.json +1 -1
- package/templates/frontend/react-ssr/.cursor/agents/accessibility-reviewer.md +22 -0
- package/templates/frontend/react-ssr/.cursor/agents/nextjs-code-reviewer.md +24 -0
- package/templates/frontend/react-ssr/.cursor/agents/react-test-expert.md +32 -0
- package/templates/frontend/react-ssr/.cursor/agents/security-auditor.md +25 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-component.md +97 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-page.md +95 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-prisma-model.md +66 -0
- package/templates/frontend/react-ssr/.cursor/commands/new-server-action.md +89 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-format.ts +64 -0
- package/templates/frontend/react-ssr/.cursor/hooks/auto-test-on-stop.ts +94 -0
- package/templates/frontend/react-ssr/.cursor/hooks/block-dangerous-commands.ts +120 -0
- package/templates/frontend/react-ssr/.cursor/hooks/ensure-tests-exist.ts +209 -0
- package/templates/frontend/react-ssr/.cursor/hooks/protect-sensitive-files.ts +101 -0
- package/templates/frontend/react-ssr/.cursor/hooks/session-context.ts +93 -0
- package/templates/frontend/react-ssr/.cursor/hooks/tsconfig.json +10 -0
- package/templates/frontend/react-ssr/.cursor/hooks.json +41 -0
- package/templates/frontend/react-ssr/.cursor/rules/auth-patterns.mdc +48 -0
- package/templates/frontend/react-ssr/.cursor/rules/code-quality.mdc +39 -0
- package/templates/frontend/react-ssr/.cursor/rules/naming-conventions.mdc +32 -0
- package/templates/frontend/react-ssr/.cursor/rules/nextjs-architecture.mdc +51 -0
- package/templates/frontend/react-ssr/.cursor/rules/prisma-standards.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/react-conventions.mdc +52 -0
- package/templates/frontend/react-ssr/.cursor/rules/testing-conventions.mdc +53 -0
- package/templates/frontend/react-ssr/.cursor/rules/ui-stack.mdc +47 -0
- package/templates/frontend/react-ssr/.cursor/skills/authjs-skills/SKILL.md +1149 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/SKILL.md +189 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/daisyUI5.skill +0 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/creating-components.md +412 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/data-display.md +341 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/feedback.md +240 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/input.md +283 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/layout.md +275 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/references/navigation.md +338 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/daisy-meta.ts +220 -0
- package/templates/frontend/react-ssr/.cursor/skills/daisyui-5/scripts/generate-daisy-safelist.ts +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/docker-expert/SKILL.md +413 -0
- package/templates/frontend/react-ssr/.cursor/skills/nextjs-app-router-patterns/SKILL.md +537 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/SKILL.md +243 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-execute.md +75 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-pull.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-push.md +148 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/db-seed.md +191 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/debug.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/dev.md +157 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/format.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/generate.md +147 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/init.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-deploy.md +127 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-dev.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-diff.md +89 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-reset.md +72 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-resolve.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/migrate-status.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/studio.md +122 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-cli/references/validate.md +53 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/client-methods.md +221 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/constructor.md +185 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/filters.md +256 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/model-queries.md +281 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/query-options.md +276 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/raw-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/relations.md +308 -0
- package/templates/frontend/react-ssr/.cursor/skills/prisma-client-api/references/transactions.md +184 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/AGENTS.md +97 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/README.md +138 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/SKILL.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/assets/templates/_template.md +26 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/_sections.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-devtools-performance.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-formprovider-memo.md +78 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/adv-testing-wrapper.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-complete-default-objects.md +66 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-separate-crud-operations.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-unique-fieldarray-per-name.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-use-field-id-as-key.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/array-virtualization-formprovider.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-avoid-double-registration.md +46 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-controller-field-props.md +56 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-local-state-combination.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-single-usecontroller-per-component.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/ctrl-usecontroller-isolation.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-async-default-values.md +69 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-default-values.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-revalidate-mode.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-should-unregister.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-useeffect-dependency.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formcfg-validation-mode.md +51 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-avoid-isvalid-with-onsubmit.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-destructure-formstate.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-getfieldstate-for-single-field.md +49 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-subscribe-to-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/formstate-useformstate-isolation.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-mui-controller-pattern.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-form-import.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-shadcn-select-wiring.md +64 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/integ-value-transform.md +59 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-avoid-watch-in-render.md +48 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-deep-subscription.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-useformcontext-sparingly.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-default-value.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-over-watch.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-usewatch-with-getvalues.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/sub-watch-specific-fields.md +54 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-delay-error.md +52 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-dynamic-schema-factory.md +57 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-error-message-strategy.md +65 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-inline-vs-resolver.md +63 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-native-validation.md +60 -0
- package/templates/frontend/react-ssr/.cursor/skills/react-hook-form/references/valid-resolver-caching.md +58 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/SKILL.md +713 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/api_reference.md +1121 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/best_practices.md +782 -0
- package/templates/frontend/react-ssr/.cursor/skills/recharts/references/examples.md +940 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/SKILL.md +114 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-gc-time.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-invalidation.md +116 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-placeholder-vs-initial.md +156 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/cache-stale-time.md +80 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/err-error-boundaries.md +150 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/inf-page-params.md +132 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-invalidate-queries.md +118 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-mutation-state.md +169 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/mut-optimistic-updates.md +137 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/network-mode.md +179 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/parallel-use-queries.md +152 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/perf-select-transform.md +144 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/persist-queries.md +194 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/pf-intent-prefetch.md +143 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-array-structure.md +50 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-factory-pattern.md +102 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-hierarchical-organization.md +76 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-include-dependencies.md +62 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/qk-serializable.md +93 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/query-cancellation.md +171 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-query-best-practices/rules/ssr-dehydration.md +158 -0
- package/templates/frontend/react-ssr/.cursor/skills/tanstack-table/SKILL.md +582 -0
- package/templates/frontend/react-ssr/.cursor/skills/zod-4/SKILL.md +216 -0
- package/templates/frontend/react-ssr/.dockerignore +14 -0
- package/templates/frontend/react-ssr/.env.example +9 -0
- package/templates/frontend/react-ssr/.husky/pre-commit +1 -0
- package/templates/frontend/react-ssr/Dockerfile +41 -0
- package/templates/frontend/react-ssr/README.md +121 -0
- package/templates/frontend/react-ssr/components.json +22 -0
- package/templates/frontend/react-ssr/docker-compose.yml +21 -0
- package/templates/frontend/react-ssr/eslint.config.mjs +26 -0
- package/templates/frontend/react-ssr/next.config.ts +7 -0
- package/templates/frontend/react-ssr/package.json +86 -0
- package/templates/frontend/react-ssr/postcss.config.mjs +5 -0
- package/templates/frontend/react-ssr/prisma/schema.prisma +75 -0
- package/templates/frontend/react-ssr/prisma/seed.ts +109 -0
- package/templates/frontend/react-ssr/prisma.config.ts +17 -0
- package/templates/frontend/react-ssr/skills-lock.json +65 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/badge.test.tsx +26 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/button.test.tsx +38 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/card.test.tsx +39 -0
- package/templates/frontend/react-ssr/src/__tests__/components/ui/input.test.tsx +32 -0
- package/templates/frontend/react-ssr/src/__tests__/hooks/useLocalStorage.test.ts +53 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/queryClient.test.ts +19 -0
- package/templates/frontend/react-ssr/src/__tests__/lib/utils.test.ts +24 -0
- package/templates/frontend/react-ssr/src/actions/auth.ts +91 -0
- package/templates/frontend/react-ssr/src/actions/contacto.ts +46 -0
- package/templates/frontend/react-ssr/src/actions/proyectos.ts +159 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/dashboard-client.tsx +321 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/dashboard/page.tsx +48 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/layout.tsx +34 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/perfil/page.tsx +85 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/page.tsx +23 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/proyectos-crud/proyectos-crud-client.tsx +472 -0
- package/templates/frontend/react-ssr/src/app/(authenticated)/ui-components/page.tsx +358 -0
- package/templates/frontend/react-ssr/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/frontend/react-ssr/src/app/auth/iniciar-sesion/page.tsx +148 -0
- package/templates/frontend/react-ssr/src/app/auth/recuperar-password/page.tsx +100 -0
- package/templates/frontend/react-ssr/src/app/auth/registro/page.tsx +154 -0
- package/templates/frontend/react-ssr/src/app/contacto/contacto-form.tsx +189 -0
- package/templates/frontend/react-ssr/src/app/contacto/page.tsx +11 -0
- package/templates/frontend/react-ssr/src/app/globals.css +99 -0
- package/templates/frontend/react-ssr/src/app/layout.tsx +22 -0
- package/templates/frontend/react-ssr/src/app/loading.tsx +7 -0
- package/templates/frontend/react-ssr/src/app/not-found.tsx +14 -0
- package/templates/frontend/react-ssr/src/app/page.tsx +331 -0
- package/templates/frontend/react-ssr/src/app/proyectos/page.tsx +178 -0
- package/templates/frontend/react-ssr/src/auth.ts +64 -0
- package/templates/frontend/react-ssr/src/components/layout/navbar.tsx +68 -0
- package/templates/frontend/react-ssr/src/components/layout/sidebar.tsx +109 -0
- package/templates/frontend/react-ssr/src/components/layout/sign-out-button.tsx +16 -0
- package/templates/frontend/react-ssr/src/components/providers.tsx +33 -0
- package/templates/frontend/react-ssr/src/components/ui/avatar.tsx +53 -0
- package/templates/frontend/react-ssr/src/components/ui/badge.tsx +42 -0
- package/templates/frontend/react-ssr/src/components/ui/breadcrumb.tsx +114 -0
- package/templates/frontend/react-ssr/src/components/ui/button.tsx +58 -0
- package/templates/frontend/react-ssr/src/components/ui/card.tsx +95 -0
- package/templates/frontend/react-ssr/src/components/ui/dialog.tsx +136 -0
- package/templates/frontend/react-ssr/src/components/ui/form.tsx +168 -0
- package/templates/frontend/react-ssr/src/components/ui/input.tsx +22 -0
- package/templates/frontend/react-ssr/src/components/ui/label.tsx +26 -0
- package/templates/frontend/react-ssr/src/components/ui/password-input.tsx +43 -0
- package/templates/frontend/react-ssr/src/components/ui/separator.tsx +30 -0
- package/templates/frontend/react-ssr/src/components/ui/table.tsx +240 -0
- package/templates/frontend/react-ssr/src/components/ui/tabs.tsx +76 -0
- package/templates/frontend/react-ssr/src/components/ui/textarea.tsx +21 -0
- package/templates/frontend/react-ssr/src/data/dashboard.ts +179 -0
- package/templates/frontend/react-ssr/src/hooks/useLocalStorage.ts +38 -0
- package/templates/frontend/react-ssr/src/lib/prisma.ts +24 -0
- package/templates/frontend/react-ssr/src/lib/queryClient.ts +25 -0
- package/templates/frontend/react-ssr/src/lib/utils.ts +6 -0
- package/templates/frontend/react-ssr/src/proxy.ts +31 -0
- package/templates/frontend/react-ssr/src/test/mocks/next-navigation.ts +16 -0
- package/templates/frontend/react-ssr/src/test/setup.ts +1 -0
- package/templates/frontend/react-ssr/src/test/utils.tsx +30 -0
- package/templates/frontend/react-ssr/src/types/index.ts +36 -0
- package/templates/frontend/react-ssr/tsconfig.json +41 -0
- package/templates/frontend/react-ssr/vitest.config.ts +41 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tanstack-table
|
|
3
|
+
description: Headless UI for building powerful tables & datagrids for TS/JS, React, Vue, Solid, Svelte, Qwik, Angular, and Lit.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
TanStack Table is a headless UI library for building data tables and datagrids. It provides logic for sorting, filtering, pagination, grouping, expanding, column pinning/ordering/visibility/resizing, and row selection - without rendering any markup or styles.
|
|
10
|
+
|
|
11
|
+
**Package:** `@tanstack/react-table`
|
|
12
|
+
**Utilities:** `@tanstack/match-sorter-utils` (fuzzy filtering)
|
|
13
|
+
**Current Version:** v8
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @tanstack/react-table
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Core Architecture
|
|
22
|
+
|
|
23
|
+
### Building Blocks
|
|
24
|
+
|
|
25
|
+
1. **Column Definitions** - describe columns (data access, rendering, features)
|
|
26
|
+
2. **Table Instance** - central coordinator with state and APIs
|
|
27
|
+
3. **Row Models** - data processing pipeline (filter -> sort -> group -> paginate)
|
|
28
|
+
4. **Headers, Rows, Cells** - renderable units
|
|
29
|
+
|
|
30
|
+
### Critical: Data & Column Stability
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
// WRONG - new references every render, causes infinite loops
|
|
34
|
+
const table = useReactTable({
|
|
35
|
+
data: fetchedData.results, // new ref!
|
|
36
|
+
columns: [{ accessorKey: 'name' }], // new ref!
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
// CORRECT - stable references
|
|
40
|
+
const columns = useMemo(() => [...], [])
|
|
41
|
+
const data = useMemo(() => fetchedData?.results ?? [], [fetchedData])
|
|
42
|
+
|
|
43
|
+
const table = useReactTable({ data, columns, getCoreRowModel: getCoreRowModel() })
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Column Definitions
|
|
47
|
+
|
|
48
|
+
### Using createColumnHelper (Recommended)
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { createColumnHelper } from '@tanstack/react-table'
|
|
52
|
+
|
|
53
|
+
type Person = {
|
|
54
|
+
firstName: string
|
|
55
|
+
lastName: string
|
|
56
|
+
age: number
|
|
57
|
+
status: 'active' | 'inactive'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const columnHelper = createColumnHelper<Person>()
|
|
61
|
+
|
|
62
|
+
const columns = [
|
|
63
|
+
// Accessor column (data column)
|
|
64
|
+
columnHelper.accessor('firstName', {
|
|
65
|
+
header: 'First Name',
|
|
66
|
+
cell: info => info.getValue(),
|
|
67
|
+
footer: info => info.column.id,
|
|
68
|
+
}),
|
|
69
|
+
|
|
70
|
+
// Accessor with function
|
|
71
|
+
columnHelper.accessor(row => row.lastName, {
|
|
72
|
+
id: 'lastName', // required with accessorFn
|
|
73
|
+
header: () => <span>Last Name</span>,
|
|
74
|
+
cell: info => <i>{info.getValue()}</i>,
|
|
75
|
+
}),
|
|
76
|
+
|
|
77
|
+
// Display column (no data, custom rendering)
|
|
78
|
+
columnHelper.display({
|
|
79
|
+
id: 'actions',
|
|
80
|
+
header: 'Actions',
|
|
81
|
+
cell: ({ row }) => (
|
|
82
|
+
<button onClick={() => deleteRow(row.original)}>Delete</button>
|
|
83
|
+
),
|
|
84
|
+
}),
|
|
85
|
+
|
|
86
|
+
// Group column (nested headers)
|
|
87
|
+
columnHelper.group({
|
|
88
|
+
id: 'info',
|
|
89
|
+
header: 'Info',
|
|
90
|
+
columns: [
|
|
91
|
+
columnHelper.accessor('age', { header: 'Age' }),
|
|
92
|
+
columnHelper.accessor('status', { header: 'Status' }),
|
|
93
|
+
],
|
|
94
|
+
}),
|
|
95
|
+
]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Column Options
|
|
99
|
+
|
|
100
|
+
| Option | Type | Description |
|
|
101
|
+
|--------|------|-------------|
|
|
102
|
+
| `id` | `string` | Unique identifier (auto-derived from accessorKey) |
|
|
103
|
+
| `accessorKey` | `string` | Dot-notation path to row data |
|
|
104
|
+
| `accessorFn` | `(row) => any` | Custom accessor function |
|
|
105
|
+
| `header` | `string \| (context) => ReactNode` | Header renderer |
|
|
106
|
+
| `cell` | `(context) => ReactNode` | Cell renderer |
|
|
107
|
+
| `footer` | `(context) => ReactNode` | Footer renderer |
|
|
108
|
+
| `size` | `number` | Default width (default: 150) |
|
|
109
|
+
| `minSize` | `number` | Min width (default: 20) |
|
|
110
|
+
| `maxSize` | `number` | Max width |
|
|
111
|
+
| `enableSorting` | `boolean` | Enable sorting |
|
|
112
|
+
| `sortingFn` | `string \| SortingFn` | Sort function |
|
|
113
|
+
| `enableFiltering` | `boolean` | Enable filtering |
|
|
114
|
+
| `filterFn` | `string \| FilterFn` | Filter function |
|
|
115
|
+
| `enableGrouping` | `boolean` | Enable grouping |
|
|
116
|
+
| `aggregationFn` | `string \| AggregationFn` | Aggregation function |
|
|
117
|
+
| `enableHiding` | `boolean` | Enable visibility toggle |
|
|
118
|
+
| `enableResizing` | `boolean` | Enable resizing |
|
|
119
|
+
| `enablePinning` | `boolean` | Enable pinning |
|
|
120
|
+
| `meta` | `any` | Custom metadata |
|
|
121
|
+
|
|
122
|
+
## Table Instance
|
|
123
|
+
|
|
124
|
+
### Creating a Table
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import {
|
|
128
|
+
useReactTable,
|
|
129
|
+
getCoreRowModel,
|
|
130
|
+
getSortedRowModel,
|
|
131
|
+
getFilteredRowModel,
|
|
132
|
+
getPaginationRowModel,
|
|
133
|
+
flexRender,
|
|
134
|
+
} from '@tanstack/react-table'
|
|
135
|
+
|
|
136
|
+
function MyTable() {
|
|
137
|
+
const [sorting, setSorting] = useState<SortingState>([])
|
|
138
|
+
const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([])
|
|
139
|
+
const [pagination, setPagination] = useState<PaginationState>({
|
|
140
|
+
pageIndex: 0,
|
|
141
|
+
pageSize: 10,
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const table = useReactTable({
|
|
145
|
+
data,
|
|
146
|
+
columns,
|
|
147
|
+
state: { sorting, columnFilters, pagination },
|
|
148
|
+
onSortingChange: setSorting,
|
|
149
|
+
onColumnFiltersChange: setColumnFilters,
|
|
150
|
+
onPaginationChange: setPagination,
|
|
151
|
+
getCoreRowModel: getCoreRowModel(),
|
|
152
|
+
getSortedRowModel: getSortedRowModel(),
|
|
153
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
154
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<table>
|
|
159
|
+
<thead>
|
|
160
|
+
{table.getHeaderGroups().map(headerGroup => (
|
|
161
|
+
<tr key={headerGroup.id}>
|
|
162
|
+
{headerGroup.headers.map(header => (
|
|
163
|
+
<th key={header.id} onClick={header.column.getToggleSortingHandler()}>
|
|
164
|
+
{header.isPlaceholder ? null :
|
|
165
|
+
flexRender(header.column.columnDef.header, header.getContext())}
|
|
166
|
+
{{ asc: ' ↑', desc: ' ↓' }[header.column.getIsSorted() as string] ?? null}
|
|
167
|
+
</th>
|
|
168
|
+
))}
|
|
169
|
+
</tr>
|
|
170
|
+
))}
|
|
171
|
+
</thead>
|
|
172
|
+
<tbody>
|
|
173
|
+
{table.getRowModel().rows.map(row => (
|
|
174
|
+
<tr key={row.id}>
|
|
175
|
+
{row.getVisibleCells().map(cell => (
|
|
176
|
+
<td key={cell.id}>
|
|
177
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
178
|
+
</td>
|
|
179
|
+
))}
|
|
180
|
+
</tr>
|
|
181
|
+
))}
|
|
182
|
+
</tbody>
|
|
183
|
+
</table>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Sorting
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
const table = useReactTable({
|
|
192
|
+
state: { sorting },
|
|
193
|
+
onSortingChange: setSorting,
|
|
194
|
+
getSortedRowModel: getSortedRowModel(),
|
|
195
|
+
enableSorting: true,
|
|
196
|
+
enableMultiSort: true,
|
|
197
|
+
// manualSorting: true, // For server-side sorting
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
// Built-in sort functions: 'alphanumeric', 'text', 'datetime', 'basic'
|
|
201
|
+
// Column-level: sortingFn: 'alphanumeric'
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Filtering
|
|
205
|
+
|
|
206
|
+
### Column Filtering
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
const table = useReactTable({
|
|
210
|
+
state: { columnFilters },
|
|
211
|
+
onColumnFiltersChange: setColumnFilters,
|
|
212
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
213
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
214
|
+
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
215
|
+
getFacetedMinMaxValues: getFacetedMinMaxValues(),
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
// Built-in: 'includesString', 'equalsString', 'arrIncludes', 'inNumberRange', etc.
|
|
219
|
+
|
|
220
|
+
// Filter UI
|
|
221
|
+
function Filter({ column }) {
|
|
222
|
+
return (
|
|
223
|
+
<input
|
|
224
|
+
value={(column.getFilterValue() ?? '') as string}
|
|
225
|
+
onChange={e => column.setFilterValue(e.target.value)}
|
|
226
|
+
placeholder={`Filter... (${column.getFacetedUniqueValues()?.size})`}
|
|
227
|
+
/>
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Global Filtering
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
const [globalFilter, setGlobalFilter] = useState('')
|
|
236
|
+
|
|
237
|
+
const table = useReactTable({
|
|
238
|
+
state: { globalFilter },
|
|
239
|
+
onGlobalFilterChange: setGlobalFilter,
|
|
240
|
+
globalFilterFn: 'includesString',
|
|
241
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
242
|
+
})
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Fuzzy Filtering
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
import { rankItem } from '@tanstack/match-sorter-utils'
|
|
249
|
+
|
|
250
|
+
const fuzzyFilter: FilterFn<any> = (row, columnId, value, addMeta) => {
|
|
251
|
+
const itemRank = rankItem(row.getValue(columnId), value)
|
|
252
|
+
addMeta({ itemRank })
|
|
253
|
+
return itemRank.passed
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const table = useReactTable({
|
|
257
|
+
filterFns: { fuzzy: fuzzyFilter },
|
|
258
|
+
globalFilterFn: 'fuzzy',
|
|
259
|
+
})
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Pagination
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
const table = useReactTable({
|
|
266
|
+
state: { pagination },
|
|
267
|
+
onPaginationChange: setPagination,
|
|
268
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
269
|
+
// For server-side:
|
|
270
|
+
// manualPagination: true,
|
|
271
|
+
// pageCount: serverPageCount,
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
// Navigation
|
|
275
|
+
table.nextPage()
|
|
276
|
+
table.previousPage()
|
|
277
|
+
table.firstPage()
|
|
278
|
+
table.lastPage()
|
|
279
|
+
table.setPageSize(20)
|
|
280
|
+
table.getCanNextPage() // boolean
|
|
281
|
+
table.getCanPreviousPage() // boolean
|
|
282
|
+
table.getPageCount() // total pages
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## Row Selection
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
const [rowSelection, setRowSelection] = useState<RowSelectionState>({})
|
|
289
|
+
|
|
290
|
+
const table = useReactTable({
|
|
291
|
+
state: { rowSelection },
|
|
292
|
+
onRowSelectionChange: setRowSelection,
|
|
293
|
+
enableRowSelection: true,
|
|
294
|
+
enableMultiRowSelection: true,
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
// Checkbox column
|
|
298
|
+
columnHelper.display({
|
|
299
|
+
id: 'select',
|
|
300
|
+
header: ({ table }) => (
|
|
301
|
+
<input
|
|
302
|
+
type="checkbox"
|
|
303
|
+
checked={table.getIsAllRowsSelected()}
|
|
304
|
+
onChange={table.getToggleAllRowsSelectedHandler()}
|
|
305
|
+
/>
|
|
306
|
+
),
|
|
307
|
+
cell: ({ row }) => (
|
|
308
|
+
<input
|
|
309
|
+
type="checkbox"
|
|
310
|
+
checked={row.getIsSelected()}
|
|
311
|
+
disabled={!row.getCanSelect()}
|
|
312
|
+
onChange={row.getToggleSelectedHandler()}
|
|
313
|
+
/>
|
|
314
|
+
),
|
|
315
|
+
})
|
|
316
|
+
|
|
317
|
+
// Get selected rows
|
|
318
|
+
table.getSelectedRowModel().rows
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Column Visibility
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({})
|
|
325
|
+
|
|
326
|
+
const table = useReactTable({
|
|
327
|
+
state: { columnVisibility },
|
|
328
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
329
|
+
})
|
|
330
|
+
|
|
331
|
+
// Toggle UI
|
|
332
|
+
{table.getAllLeafColumns().map(column => (
|
|
333
|
+
<label key={column.id}>
|
|
334
|
+
<input
|
|
335
|
+
type="checkbox"
|
|
336
|
+
checked={column.getIsVisible()}
|
|
337
|
+
onChange={column.getToggleVisibilityHandler()}
|
|
338
|
+
/>
|
|
339
|
+
{column.id}
|
|
340
|
+
</label>
|
|
341
|
+
))}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Column Pinning
|
|
345
|
+
|
|
346
|
+
```typescript
|
|
347
|
+
const [columnPinning, setColumnPinning] = useState<ColumnPinningState>({
|
|
348
|
+
left: ['select', 'name'],
|
|
349
|
+
right: ['actions'],
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
const table = useReactTable({
|
|
353
|
+
state: { columnPinning },
|
|
354
|
+
onColumnPinningChange: setColumnPinning,
|
|
355
|
+
enableColumnPinning: true,
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
// Render pinned sections separately
|
|
359
|
+
row.getLeftVisibleCells() // Left-pinned
|
|
360
|
+
row.getCenterVisibleCells() // Unpinned
|
|
361
|
+
row.getRightVisibleCells() // Right-pinned
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Column Resizing
|
|
365
|
+
|
|
366
|
+
```typescript
|
|
367
|
+
const table = useReactTable({
|
|
368
|
+
enableColumnResizing: true,
|
|
369
|
+
columnResizeMode: 'onChange', // 'onChange' | 'onEnd'
|
|
370
|
+
defaultColumn: { size: 150, minSize: 50, maxSize: 500 },
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
// Resize handle in header
|
|
374
|
+
<div
|
|
375
|
+
onMouseDown={header.getResizeHandler()}
|
|
376
|
+
onTouchStart={header.getResizeHandler()}
|
|
377
|
+
className={`resizer ${header.column.getIsResizing() ? 'isResizing' : ''}`}
|
|
378
|
+
/>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Grouping & Aggregation
|
|
382
|
+
|
|
383
|
+
```typescript
|
|
384
|
+
const [grouping, setGrouping] = useState<GroupingState>([])
|
|
385
|
+
|
|
386
|
+
const table = useReactTable({
|
|
387
|
+
state: { grouping },
|
|
388
|
+
onGroupingChange: setGrouping,
|
|
389
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
390
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
391
|
+
})
|
|
392
|
+
|
|
393
|
+
// Built-in aggregation: 'sum', 'min', 'max', 'mean', 'median', 'count', 'unique', 'uniqueCount'
|
|
394
|
+
columnHelper.accessor('amount', {
|
|
395
|
+
aggregationFn: 'sum',
|
|
396
|
+
aggregatedCell: ({ getValue }) => `Total: ${getValue()}`,
|
|
397
|
+
})
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## Row Expanding
|
|
401
|
+
|
|
402
|
+
```typescript
|
|
403
|
+
const [expanded, setExpanded] = useState<ExpandedState>({})
|
|
404
|
+
|
|
405
|
+
const table = useReactTable({
|
|
406
|
+
state: { expanded },
|
|
407
|
+
onExpandedChange: setExpanded,
|
|
408
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
409
|
+
getSubRows: (row) => row.subRows, // For hierarchical data
|
|
410
|
+
})
|
|
411
|
+
|
|
412
|
+
// Expand toggle
|
|
413
|
+
<button onClick={row.getToggleExpandedHandler()}>
|
|
414
|
+
{row.getIsExpanded() ? '−' : '+'}
|
|
415
|
+
</button>
|
|
416
|
+
|
|
417
|
+
// Detail row pattern
|
|
418
|
+
{row.getIsExpanded() && (
|
|
419
|
+
<tr>
|
|
420
|
+
<td colSpan={columns.length}>
|
|
421
|
+
<DetailComponent data={row.original} />
|
|
422
|
+
</td>
|
|
423
|
+
</tr>
|
|
424
|
+
)}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## Virtualization Integration
|
|
428
|
+
|
|
429
|
+
```typescript
|
|
430
|
+
import { useVirtualizer } from '@tanstack/react-virtual'
|
|
431
|
+
|
|
432
|
+
function VirtualizedTable() {
|
|
433
|
+
const table = useReactTable({ /* ... */ })
|
|
434
|
+
const { rows } = table.getRowModel()
|
|
435
|
+
const parentRef = useRef<HTMLDivElement>(null)
|
|
436
|
+
|
|
437
|
+
const virtualizer = useVirtualizer({
|
|
438
|
+
count: rows.length,
|
|
439
|
+
getScrollElement: () => parentRef.current,
|
|
440
|
+
estimateSize: () => 35,
|
|
441
|
+
overscan: 10,
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
return (
|
|
445
|
+
<div ref={parentRef} style={{ height: '600px', overflow: 'auto' }}>
|
|
446
|
+
<table>
|
|
447
|
+
<tbody style={{ height: `${virtualizer.getTotalSize()}px`, position: 'relative' }}>
|
|
448
|
+
{virtualizer.getVirtualItems().map(virtualRow => {
|
|
449
|
+
const row = rows[virtualRow.index]
|
|
450
|
+
return (
|
|
451
|
+
<tr
|
|
452
|
+
key={row.id}
|
|
453
|
+
style={{
|
|
454
|
+
position: 'absolute',
|
|
455
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
456
|
+
height: `${virtualRow.size}px`,
|
|
457
|
+
}}
|
|
458
|
+
>
|
|
459
|
+
{row.getVisibleCells().map(cell => (
|
|
460
|
+
<td key={cell.id}>
|
|
461
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
462
|
+
</td>
|
|
463
|
+
))}
|
|
464
|
+
</tr>
|
|
465
|
+
)
|
|
466
|
+
})}
|
|
467
|
+
</tbody>
|
|
468
|
+
</table>
|
|
469
|
+
</div>
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
## Server-Side Operations
|
|
475
|
+
|
|
476
|
+
```typescript
|
|
477
|
+
const table = useReactTable({
|
|
478
|
+
data: serverData,
|
|
479
|
+
columns,
|
|
480
|
+
manualSorting: true,
|
|
481
|
+
manualFiltering: true,
|
|
482
|
+
manualPagination: true,
|
|
483
|
+
pageCount: serverPageCount,
|
|
484
|
+
state: { sorting, columnFilters, pagination },
|
|
485
|
+
onSortingChange: setSorting,
|
|
486
|
+
onColumnFiltersChange: setColumnFilters,
|
|
487
|
+
onPaginationChange: setPagination,
|
|
488
|
+
getCoreRowModel: getCoreRowModel(),
|
|
489
|
+
// Do NOT include getSortedRowModel, getFilteredRowModel, getPaginationRowModel
|
|
490
|
+
})
|
|
491
|
+
|
|
492
|
+
// Fetch data based on state
|
|
493
|
+
useEffect(() => {
|
|
494
|
+
fetchData({ sorting, filters: columnFilters, pagination })
|
|
495
|
+
}, [sorting, columnFilters, pagination])
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## TypeScript Patterns
|
|
499
|
+
|
|
500
|
+
### Extending Column Meta
|
|
501
|
+
|
|
502
|
+
```typescript
|
|
503
|
+
declare module '@tanstack/react-table' {
|
|
504
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
505
|
+
filterVariant?: 'text' | 'range' | 'select'
|
|
506
|
+
align?: 'left' | 'center' | 'right'
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Custom Filter/Sort Function Registration
|
|
512
|
+
|
|
513
|
+
```typescript
|
|
514
|
+
declare module '@tanstack/react-table' {
|
|
515
|
+
interface FilterFns {
|
|
516
|
+
fuzzy: FilterFn<unknown>
|
|
517
|
+
}
|
|
518
|
+
interface SortingFns {
|
|
519
|
+
myCustomSort: SortingFn<unknown>
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### Editable Cells via Table Meta
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
declare module '@tanstack/react-table' {
|
|
528
|
+
interface TableMeta<TData extends RowData> {
|
|
529
|
+
updateData: (rowIndex: number, columnId: string, value: unknown) => void
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
const table = useReactTable({
|
|
534
|
+
meta: {
|
|
535
|
+
updateData: (rowIndex, columnId, value) => {
|
|
536
|
+
setData(old => old.map((row, i) =>
|
|
537
|
+
i === rowIndex ? { ...row, [columnId]: value } : row
|
|
538
|
+
))
|
|
539
|
+
},
|
|
540
|
+
},
|
|
541
|
+
})
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
## Key Imports
|
|
545
|
+
|
|
546
|
+
```typescript
|
|
547
|
+
import {
|
|
548
|
+
createColumnHelper, flexRender, useReactTable,
|
|
549
|
+
getCoreRowModel, getSortedRowModel, getFilteredRowModel,
|
|
550
|
+
getPaginationRowModel, getGroupedRowModel, getExpandedRowModel,
|
|
551
|
+
getFacetedRowModel, getFacetedUniqueValues, getFacetedMinMaxValues,
|
|
552
|
+
} from '@tanstack/react-table'
|
|
553
|
+
|
|
554
|
+
import type {
|
|
555
|
+
ColumnDef, SortingState, ColumnFiltersState, VisibilityState,
|
|
556
|
+
PaginationState, ExpandedState, RowSelectionState, GroupingState,
|
|
557
|
+
ColumnOrderState, ColumnPinningState, FilterFn, SortingFn,
|
|
558
|
+
} from '@tanstack/react-table'
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
## Best Practices
|
|
562
|
+
|
|
563
|
+
1. **Always memoize `data` and `columns`** to prevent infinite re-renders
|
|
564
|
+
2. **Use `flexRender`** for all header/cell/footer rendering
|
|
565
|
+
3. **Use `table.getRowModel().rows`** for final rendered rows (not getCoreRowModel)
|
|
566
|
+
4. **Import only needed row models** - each adds processing to the pipeline
|
|
567
|
+
5. **Use `getRowId`** for stable row keys when data has unique IDs
|
|
568
|
+
6. **Use `manualX` options** for server-side operations
|
|
569
|
+
7. **Pair controlled state** with both `state.X` and `onXChange`
|
|
570
|
+
8. **Use module augmentation** for custom meta, filter fns, sort fns
|
|
571
|
+
9. **Use column helper** for type-safe column definitions
|
|
572
|
+
10. **Set `autoResetPageIndex: true`** when filtering should reset pagination
|
|
573
|
+
|
|
574
|
+
## Common Pitfalls
|
|
575
|
+
|
|
576
|
+
- Defining columns inline (creates new ref each render)
|
|
577
|
+
- Forgetting `getCoreRowModel()` (required for all tables)
|
|
578
|
+
- Using row models without importing them
|
|
579
|
+
- Not providing `id` when using `accessorFn`
|
|
580
|
+
- Mixing `manualPagination` with client-side `getPaginationRowModel`
|
|
581
|
+
- Forgetting `colSpan` for grouped headers
|
|
582
|
+
- Not handling `header.isPlaceholder` for group column spacers
|