본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)29k · #9818

table-state

하는 일

이 스킬은 현재 페이지 같은 표 설정을 Octane 상태에 보관하고 화면에 보여 주는 방법을 설명합니다. 표와 페이지가 계속 맞춰져야 하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓페이지 버튼이 현재 표 페이지를 보여 주고 클릭하면 업데이트되어야 할 때.
  • ✓Octane 상태의 표 설정을 표에 넘겨야 할 때.
  • ✓표의 값이 바뀌었는데 화면에서 새로 고쳐지지 않는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/TanStack/table/blob/main/packages/octane-table/skills/table-state/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“다음 버튼을 클릭할 때 Octane 표의 페이지 번호가 화면에서 계속 최신이 되도록 하려면 어떻게 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

설정을 Octane 상태에 보관하고, 값과 setter를 모두 표에 넘긴 뒤, 마크업에서 선택된 상태를 읽는 방법을 보여 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Load intent load @tanstack/table-core#table-state first for shared ownership, initialization, updater, and reset rules.

useTable selects all registered state by default. Its second argument changes the selected shape exposed as table.state and shallow-gates owner rerenders. Atom .get() and table.store.state reads are snapshots; use selected state or a rendered table.Subscribe to update the UI.

Controlled slice setup

import { useState } from 'octane'
import {
  rowPaginationFeature,
  tableFeatures,
  useTable,
} from '@tanstack/octane-table'

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

function PageStatus() @{
  const [pagination, setPagination] = useState({ pageIndex: 0, pageSize: 20 })
  const table = useTable({
    features,
    columns,
    data,
    state: { pagination },
    onPaginationChange: setPagination,
  })

  <button onClick={() => table.nextPage()}>
    Page {String(table.state.pagination.pageIndex + 1)}
  </button>
}

Reactive boundaries

  • Pass both the controlled value and its callback. Octane setters accept Table's value-or-updater callbacks; a callback alone cannot feed the new value back.
  • Render <table.Subscribe> as a component. Calling it as a normal function shares the owner's compiler slots instead of creating an independent hook scope.
  • useTable stages fresh options for same-render reads. Controlled state reaches the store only from an accepted layout commit, so abandoned work cannot publish speculative values.
  • A stable atom from @tanstack/octane-store is a direct synchronous owner. Table writes reach it immediately; it takes precedence over controlled state for the same slice.
  • Keep features, columns, and data stable. Use the default selector until render cost justifies narrower subscriptions.

Read for the task

For advanced reactive boundaries, shared atoms, or detailed subscription examples, read reactivity. For construction or rendering setup, read getting-started.

API discovery

Inspect node_modules/@tanstack/octane-table/src/index.d.ts, the matching *.tsrx.d.ts sidecar, and src/types.ts. This package publishes authored source; core APIs are in installed @tanstack/table-core/dist/.

자주 묻는 질문

get()으로 값을 읽으면 화면이 왜 업데이트되지 않나요?

그런 읽기는 스냅샷이므로 화면은 선택된 상태나 렌더링된 구독 컴포넌트에서만 업데이트됩니다.

setter가 업데이터 함수를 받을 수 있나요?

네, Octane setter는 표가 쓰는 값 또는 업데이터 콜백을 받습니다.

상태를 동기화하려면 무엇을 넘겨야 하나요?

제어되는 값과 그 콜백을 함께 넘겨야 합니다. 콜백만으로는 새 값을 다시 전달할 수 없습니다.

상세 정보

작성자의 원본 설명

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

repo: TanStack/table

인기도

GitHub 스타
29k
순위
#9818
라이선스
MIT
업데이트
2026. 10. 21.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬