[Feature request] We need a new component <Table.HeadRow>

オープン
#1,467 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

packages/ui/src/components/Table/TableHead.tsx の Table.Head 内にあるハードコードされた tr から始め、近くにある Table コンポーネントを調べて命名と prop のパターンを確認します。要求された Table.HeadRow エントリポイントを追加し、利用側がグループ化されたヘッダーのヘッダー行を制御できるようにしつつ、既存の Table.Head の動作を維持します。例の使用方法でコンポーネントが引き続き正しくレンダリングされることを確認します。

索引モデルが issue の本文から書いたものです。

説明

:bug: bug :dart: new component :rocket: enhancement confirmed help wanted
  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

Summary

Hi, I'm trying to implement the @tanstack/react-table library with the Table component, but the tr in the <Table.Head> component is not accessible, and is hardcoded inside the component. Can make a new component for that element please? Regards.

https://github.com/themesberg/flowbite-react/blob/main/packages/ui/src/components/Table/TableHead.tsx#L29

Here is an example and the link to the library
https://tanstack.com/table/latest/docs/introduction

export default function Table<T>({ data, columns }: TableProps<T>) {
  const table = useReactTable({
    data,
    columns,
    getCoreRowModel: getCoreRowModel(),
  });

  return (
    <table>
      <thead>
        {table.getHeaderGroups().map((headerGroup) => (
          <tr key={headerGroup.id}> {/* Here, I want to have access to the tr so I can make header groups */}
            {headerGroup.headers.map((header) => (
              <th key={header.id}>
                {flexRender(
                  header.column.columnDef.header,
                  header.getContext()
                )}
              </th>
            ))}
          </tr>
        ))}
      </thead>
      <tbody>
        {table.getRowModel().rows.map((row) => (
          <tr key={row.id}>
            {row.getVisibleCells().map((cell) => (
              <td key={cell.id}>
                {flexRender(cell.column.columnDef.cell, cell.getContext())}
              </td>
            ))}
          </tr>
        ))}
      </tbody>
    </table>
  );
}
主要言語
TypeScript
スター
2.1k
フォーク
502
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

themesberg/flowbite-react のほかの issue

themesberg/flowbite-react の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。