本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)29k · #9830

table-state

できること

ページ番号などのテーブルの設定が、Solidアプリでどう働くかを説明します。テーブルと自分のコンポーネントが同じ値に反応する必要があるSolid開発者向けです。

使う場面

  • ✓Solidのテンプレートで現在のページなど、テーブルの設定を表示する必要があるとき。
  • ✓テーブルの設定をSolidのシグナルやmemoにつなぐ必要があるとき。
  • ✓テーブルが変わってもコンポーネント本体で読んだ値が更新されないとき。

スキルのリンク

https://github.com/TanStack/table/blob/main/packages/solid-table/skills/table-state/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/TanStack/table/blob/main/packages/solid-table/skills/table-state/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Solidテーブルの現在のページ番号を、ボタンのラベルに最新の状態で表示する方法を教えてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

JSX、memo、effectの中でテーブルのatomsを読むと、Solidが変化を追跡する仕組みを示します。また、更新関数を受け付けるセッターで制御されたシグナルを渡す方法も説明します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Solid table state

Before starting, run intent load @tanstack/table-core#table-state for shared ownership, initialization, updates, and resets.

Read reactive state

The adapter backs table atoms with Solid signals and memos. Read table.atoms.<slice>.get() inside JSX, createMemo, createEffect, or another tracked scope. A value captured once outside tracking is only a snapshot. Solid has no React-style selected table.state.

table.Subscribe is deprecated and adds no subscription or tracking scope. Read table.atoms directly inside JSX, memos, or effects. Component bodies are untracked; keep reads inside tracked scopes. Track the required atoms instead of adding whole-store forced rerenders.

Control a slice

Keep features and columns stable. Expose changing data and controlled state through getters. Solid setters already accept Table's raw values and updater functions:

import { createMemo, createSignal } from 'solid-js'
import {
  createTable,
  rowPaginationFeature,
  tableFeatures,
  type PaginationState,
} from '@tanstack/solid-table'

const features = tableFeatures({ rowPaginationFeature })
const columns = [{ accessorKey: 'name' }]

export function PageControl() {
  const [data] = createSignal([{ name: 'Ada' }])
  const [pagination, setPagination] = createSignal<PaginationState>({
    pageIndex: 0,
    pageSize: 20,
  })
  const table = createTable({
    features,
    columns,
    get data() {
      return data()
    },
    state: {
      get pagination() {
        return pagination()
      },
    },
    onPaginationChange: setPagination,
  })
  const pageSize = createMemo(() => table.atoms.pagination.get().pageSize)
  return (
    <button onClick={() => table.setPageSize(50)}>
      {pageSize()} rows per page
    </button>
  )
}

When wrapping a setter to add a side effect, resolve both updater forms before storing the result. For shared atom ownership, use createAtom from @tanstack/solid-store and pass it in atoms.<slice>.

For external atoms, custom updater wrappers, or tracking failures, read reactivity details. If this task changes processing features, run intent load @tanstack/table-core#table-features and read the relevant feature references.

API discovery

Inspect node_modules/@tanstack/solid-table/dist/createTable.d.ts and reactivity.d.ts; inspect @tanstack/solid-store declarations for external atoms.

よくある質問

コンポーネント本体で値を読んでも更新されないのはなぜですか?

Solidはコンポーネント本体での読み取りを追跡しないため、そこでの値は単なるスナップショットになるからです。

テーブルのSubscribeコンポーネントはまだ必要ですか?

いいえ。非推奨になっており、JSX、memo、effectでatomsを直接読めば十分だとこのスキルは説明しています。

セッターは更新関数を受け付けますか?

はい。Solidのセッターは、値そのものと更新関数の両方を受け付けます。テーブルもこの形式を想定しています。

詳細

作者による元の説明

Read and control Table v9 state in solid. Use for tracked reads, subscriptions, controlled slices, and framework-specific reactive boundaries.

repo: TanStack/table

人気

GitHubのスター
29k
ランキング
#9830
ライセンス
MIT
更新日
2026/10/21

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル