Zum Inhalt springen
Skillpedia
Websites & UI (Frontend)29k · #9835

custom-features

Was er macht

Dieser Skill zeigt, wie du ein wiederverwendbares Feature oder Plugin baust, das neuen Status oder neues Verhalten zu TanStack Table hinzufügt. Er ist für fortgeschrittene Entwickler gedacht, deren Anforderungen die eingebauten Features nicht abdecken.

Wann du ihn nutzt

  • ✓Wenn du wiederverwendbaren Status oder wiederverwendbares Verhalten zu Tabellenobjekten hinzufügen musst.
  • ✓Wenn eingebaute Optionen und typisierte Meta-Daten deinen Renderer oder deine App-Einstellungen nicht abdecken.
  • ✓Wenn du ein Plugin schreibst, das Lebenszyklus-Hooks und Tabellenmethoden korrekt registrieren muss.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/TanStack/table/blob/main/packages/table-core/skills/custom-features/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Die eingebauten Features von TanStack Table decken nicht ab, was ich brauche. Wie schreibe ich mein eigenes Plugin?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Er führt durch die Deklaration des Features, das Bewahren des Nutzerstatus, das Hinzufügen von Tabellen- und Objektmethoden in den Lebenszyklus-Hooks und die Registrierung des Plugins über ein stabiles Feature-Objekt.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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.

Häufige Fragen

Wann sollte ich kein eigenes Feature schreiben?

Der Skill sagt, dass du typisierte Meta-Daten nutzen solltest, wenn das Verhalten nur Callbacks oder Renderer-Daten weitergibt.

Installiert die Deklaration eines Feature-Typs das Verhalten?

Nein. Der Skill sagt, Deklarationen allein installieren nichts, daher müssen die Laufzeit-Implementierungen zu den deklarierten Typen passen.

Wo wird das Plugin registriert?

Über den Aufruf tableFeatures, damit Typinferenz und Komposition es einbeziehen.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
29k
Platz im Ranking
#9835
Lizenz
MIT
Aktualisiert
21.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills