helpscout / hsds-react

Help Scout Design System (HSDS) — React Component Library
MIT License
86 stars 17 forks source link

Allow table columns to be changed #1042

Closed knicklabs closed 2 years ago

knicklabs commented 2 years ago

Problem/Feature

It is currently not possible to dynamically change the columns of a table because the state does not update when the props change. This small change ensures that the columns state stays in sync with the columns prop.

This was needed to support changing Mailbox views. When we change views, we load new conversations that get loaded into the table as rows; however we also need to change the columns to show based on the view. See https://github.com/helpscout/hs-app-ui/pull/319 for more context.

knicklabs commented 2 years ago

@tinkertrain I'm not overly familiar with the table component and while I opened a PR with a proposed change, I'm totally up for working with you to figure out the best way to move forward. Rather than adding a lot of details concerning something in a private repo to this public repo, I'll just refer you to the hs-app PR for more information. Thanks!