Saltar al contenido
Skillpedia
Sitios e interfaces (frontend)29 mil · #9835

custom-features

Qué hace

Esta habilidad muestra cómo construir una función reutilizable, o plugin, que añade estado o comportamiento nuevo a TanStack Table. Es para desarrolladores avanzados cuyas necesidades no cubren las funciones integradas.

Cuándo usarla

  • ✓Cuando necesitas un estado o un comportamiento reutilizable que debe añadirse a los objetos de la tabla.
  • ✓Cuando las opciones integradas y el meta tipado no pueden manejar tu renderizador o los ajustes de tu app.
  • ✓Cuando escribes un plugin que debe registrar correctamente sus hooks de ciclo de vida y sus métodos de tabla.

Link de la skill

https://github.com/TanStack/table/blob/main/packages/table-core/skills/custom-features/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/TanStack/table/blob/main/packages/table-core/skills/custom-features/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Las funciones integradas de TanStack Table no cubren lo que necesito. ¿Cómo escribo mi propio plugin?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Recorre cómo declarar la función, conservar el estado del usuario, añadir métodos a la tabla y a los objetos durante los hooks de ciclo de vida, y registrar el plugin con un objeto de función estable.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Author a custom feature

Read core and feature architecture first. Use a plugin for reusable state or behavior that must augment Table objects. Built-in options and typed tableMeta/columnMeta are usually enough for renderer callbacks and application configuration.

Implementation workflow

  1. Identify the state, options, and object methods the behavior owns. If it only passes callbacks or renderer data, read scoped meta typing and use meta instead.
  2. Before declaring plugin types or writing lifecycle hooks, read the complete plugin example. It enumerates all 10 public FeatureMaps, the API assignment helpers, lifecycle ordering, and the advanced row-model maps.
  3. Declare the feature key in Plugins. Merge only FeatureMaps with matching runtime implementations; declarations alone install no behavior.
  4. Preserve user state after defaults in getInitialState; connect state updaters in default options. Install table methods with assignTableAPIs and object methods with assignPrototypeAPIs inside the corresponding lifecycle hooks.
  5. Keep the feature object and tableFeatures({ customFeature }) result stable. Register the plugin through tableFeatures so inference and composition include it.
  6. Verify the advertised state, options, methods, and resets on a constructed table. Each declared API must exist at runtime; reset behavior must respect the state owner.

Lifecycle boundaries

Use initTableInstanceData for mutable data owned by one table and resetTableInstanceData for clearing its transient contents. All feature initialization finishes before any constructTableAPIs hook. Keep method installation separate from data allocation.

Prototype methods are shared across the table's rows, columns, cells, or headers. Read per-object values through the method's current instance, and use the supported instance-data hooks for mutable fields. Read the example's installation rules before adding memoized methods or advanced row-model/cache wiring.

Common failures

  • Types without matching runtime hooks advertise APIs that do not exist.
  • Ad hoc mutation of constructed instances bypasses feature registration and inferred composition.
  • Treating the density example as the only extension pattern misses column definitions and the other public FeatureMaps. Choose the maps required by the behavior; advanced row-model declarations also require runtime pipeline/cache wiring.

Installed API discovery

Inspect node_modules/@tanstack/table-core/dist/types/TableFeatures.d.ts, the exported *_FeatureMap interfaces in dist/types/, and assignTableAPIs/assignPrototypeAPIs in dist/utils.d.ts. Follow declarations under dist/features/ for comparable stock lifecycle signatures.

Preguntas frecuentes

¿Cuándo no debo escribir una función personalizada?

La habilidad indica que, si el comportamiento solo pasa callbacks o datos del renderizador, debes usar el meta tipado.

¿Declarar un tipo de función instala su comportamiento?

No. La habilidad indica que las declaraciones por sí solas no instalan nada, así que las implementaciones en tiempo de ejecución deben coincidir con los tipos declarados.

¿Dónde debe registrarse el plugin?

Mediante la llamada tableFeatures, para que la inferencia de tipos y la composición lo incluyan.

Detalles

Descripción original del autor

Implement a Table v9 plugin when built-ins and typed meta are insufficient. Covers FeatureMaps, runtime lifecycle hooks, prototypes, and a complete checked example.

repo: TanStack/table

Popularidad

Estrellas en GitHub
29 mil
Posición en el ranking
#9835
Licencia
MIT
Actualizada
21/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas