Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

A table doesn't get updated when a defaultColumn changes

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

メンテナーはふだん 1 日以内に返信

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

  • #6587 @lx3133584 による — マージされずにクローズ

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

提供されたCodeSandboxとuseReactTableの設定から始め、defaultColumnの初期サイズを200から50に変更する動作を再現します。列サイズ調整の実装を読み、defaultColumnの変更がcolumnResizeDirectionの場合とどのように扱われるかを比較します。完了条件は、レンダリングされたテーブルの列に更新後のデフォルトサイズが反映されることです。

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

説明

Describe the bug

I used one of your examples and added a defaultColumn with an initial size to the table, which works fine. However if the defaultColumn gets updated later on, this change doesn't get reflected in the actual size of the table columns.
So if we have the below code and I set the initial size to 100 and then in the useEffect I update it to 50, it will still remain 100 for the rendered table even if the table generated by the useReactTable gets the new value. I checked the same with columnResizeDirection and it works fine.

const [defaultColumn, setDefaultColumn] = React.useState({size: 200})

  React.useEffect(() => {
    setDefaultColumn({size: 50})
  }, [])

  const table = useReactTable({
    data,
    columns,
    columnResizeMode,
    defaultColumn,
    columnResizeDirection,
    getCoreRowModel: getCoreRowModel(),
    debugTable: true,
    debugHeaders: true,
    debugColumns: true,
  })
Your minimal, reproducible example

https://codesandbox.io/p/sandbox/reacttable-lycjfh

Steps to reproduce

As in description

Expected behavior

The size of the columns gets updated when the defaultColumn gets changed

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

macOS Chrome

react-table version

8.11.6

TypeScript version

4.4.2

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
主要言語
TypeScript
スター
28.5k
フォーク
3.6k
平均マージ
19時間 40分
マージ済み PR(30日)
8

環境構築

はじめの一歩

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

TanStack/table のほかの issue

TanStack/table の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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