* size-snapshot created?
* Added docz for documentation site
* Modified .gitignore to get rid of .docz internal stuff
* Update all doc links to point to proper paths with docz
* Removed .docz folder from Git
Co-authored-by: Jason Clark <jason.clark@tcnbroadcasting.com>
* Adds dev dependency on Scarf, default opt-out. Corresponding installation instructions
* Scarf as default opt in, moved to dependencies
* Update install docs for default opt in analytics
* Remove extra period
* update yarn lock
* size-snapshot created?
* Added `disableGlobalFilter` prop and associated tests
* Updated documentation
* improvement(useglobalfilter): add `disableGlobalFilter` prop
Adding `disableGlobalFilter` prop to both table and column to allow columns to be excluded from
Global Filter
* test(usefilters.test.js): added base test for disableGlobalFilter
Needed a test to make sure that disableGlobalFilter didn't break anything when applied
* Delete .size-snapshot.json
* Update README.md
Co-authored-by: Jason Clark <jason.clark@tcnbroadcasting.com>
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
* docs(examples/material-ui-enhanced-table): add more Material UI table
This enhanced Material UI table demonstrates client side pagination, sorting, global search, add
row, and delete row.
* Update EnhancedTable.js
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
* Add option to allow toggleRowSelect to not select subRows
Iif you are using manualGrouping, it's convenient to be able
to select the group without selecting all of the children.
This adds an instance option `selectChildRows`, which defaults to true,
that can be set to false to allow selection of the group without it
selecting all of the children.
* fix lint error
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
addresses https://github.com/tannerlinsley/react-table/issues/1808
Several of the instance methods added by plugins wrap their state update
functions in useCallback, the ones that didn't do this can lead to problems
where when they are used in a component, for instance in a hook, their
required presence in the dependency array causes an infinite loop as
executing the function triggers an instance update and a new function
generation. This PR addresses this.
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
* Add fixed width column support to useFlexLayout
* Allow useFlexLayout to honor canResize by calculating flex width separately from total width.
* Update example to show the selection checkbox since that's a common fixed width use case.
* Add example for right aligning columns.
* Tweaked the styles for the table to better align the resize handles (since it made verifying the rest easier when they weren't misaligned by the scroll bar width)
Note that the resize behavior is still rather strange, but that's a separate problem that this change didn't really effect.
* swich to react-table@latest
* docs(useglobalfilter.md): corrected documentation for setGlobalFilter
* fix(useglobalfilter.js): wrapped setGlobalFilter in useCallback
Wrapped setGlobalFilter in useCallback for identity stability.
- Fixed an issue where dependency hooks were not being reduced properly, thus the table would rerender unnecessarily
- Renamed `toggleRowSelectedAll` to `toggleAllRowsSelected`. Duh...
- Added an `indeterminate` boolean prop to the default props for row selection toggle prop getters
- Renamed `selectedRowPaths` to `selectedRowIds`, which also no longer contains paths, but row IDs
- Grouped or nested row selection actions and state are now derived, instead of tracked in state.
- Rows now have a new property called `id`, which existed before and was derived from the `getRowId` option
- Rows now also have an `isSomeSelected` prop when using the `useRowSelect` hook, which denotes that at least one subRow is selected (if applicable)
- Rows' `path` property has been deprecated in favor of `id`
- Expanded state is now tracked with row IDs instead of paths
- RowState is now tracked with row IDs instead of paths
- `toggleExpandedByPath` has been renamed to `toggleExpandedById`, and thus accepts a row ID now, instead of a row path
- The exported (but undocumented) `applyHooks` function has been deprecated. Please use either `reduceHooks` or `loopHooks` utilities in your custom plugins now.
- The exported (but undocumented) `applyPropHooks` function has been deprecated. Please use the `makePropGetter` utility in your custom plugins now.
- Added the `reduceHooks` exported utility which is used to reduce a value through a collection of hooks. Each hook must return a value (mutation is discouraged)
- Added the `loopHooks` exported utility which is used to loop over a collection of hooks. Hooks are not allowed to return a value (mutation is encouraged)
- Prop-getter hook functions now support returning an array (in addition to the typical object of props). When an array is returned, each item in the array is smart-merged into a new props object (meaning it will intelligently compose and override styles and className)
- Added the `makePropGetter` exported utility which is used to create prop getters from a prop getter hook.
- Prop-getter function supplied to the table have 2 new overloaded options (in addition to the typical object of props):
- `Function(props, instance, ...row/col/context) => Array<props> | props` - If a function is passed to a prop getter function, it will receive the previous props, the table instance, and potentially more context arguments. It is then be expected to return either an array of new props (to be smart-merged with styles and classes, the latest values taking priority over the previous values) or a props object (which will replace all previous props)
- `Array<props>` - If an array is passed to a prop getter function, each prop object in the array will be smart-merged with styles and classes into the props from previous hooks (with the latest values taking priority over the previous values).
- Extracted default hooks into separate file.
- Added the `useOptions` plugin hook, which allows a plugin to reduce/modify the initial options being passed to the table
- Converted almost all usages of `instanceRef.current` to use `useGetLatest(instanceRef.current)` to help with avoiding memory leaks and to be more terse.
- Converted all previous prop-getter definitions to use the new `makePropGetter`
- Reorganized plugin hooks to declare as many hooks in the main plugin function as opposed to in the `useInstance` hook.
- Changed the `useInstanceBeforeDimensions` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the instance)
- Changed the `useInstance` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the instance)
- Change the `prepareRow` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the row)
- The `columnsBeforeHeaderGroups` and `columnsBeforeHeaderGroupsDeps` hooks have been renamed to `flatColumns` and `flatColumnsDeps` respectively, which better reflects what they are used for, rather than their order, which can remain implicit.
- Added `headerGroups` and `headerGroupDeps` hooks, which, similar to `flatColumns`, allow you to decorate (and trigger) the memoized header group generation.
- Added `columns` and `columnsDeps` hooks, which, similar to `flatColumns` and `headerGroups`, allow you to decorate (and trigger) the memoized column generation/decoration.
- The new hook order is as follows: `columns/columnsDeps` => `flatColumns/flatColumnsDeps` => `headerGroups/headerGroupsDeps`
- `useColumnVisibility` now uses the new `headerGroupsDeps` hook to trigger header group regeneration when visibility changes
These definitions mask errors in the other definitions and there are better
ways of extending these.
See https://github.com/tannerlinsley/react-table/pull/1597 for an
example of an existing prototype that was missing but harder to find
because of these definitions.
It turns out that pulling the types directly from a package slightly
changes how visible they are to the consuming application. This makes
sense, previously we explicitly adding the react-table module to the
global namespace an so didn't need explicit imports, but now that's not
the case. So add explicit imports.
* ci: test cross platform
Test on Node.js 10 and 12, long term release support versions.
Test on Linux, Mac, and Windows machines.
* fix: update ic-ci-cli to version 2
includes fixes to support windows
* ci: disable yarn gpg
* ci: double quote string for windows ci
useTableState was an early and hasty abstraction that hasn't proved useful in many ways. Anything
you could do with useTableState, you could easily do using the same options (assuming they exist) in
the useTable hook. For this reason, state is now a first class citizen of the useTable hook, along
with more sane properties and option locations for anything pertaining to state.
Width options (`width`, `minWidth`, `maxWidth`) options are now a part of the core column object.
useBlockLayout and useAbsoluteLayout hooks now use this new internalized information to implement
their layouts. Those examples have been updated. A virtualized-rows example has also been added to
show off how the useBlockLayout hook can be used to virtualize rows with react-window.
* useAbsoluteLayout: To build tables with divs
* Adding `placeholderOf` attribute to column
* Adding `useAbsoluteLayout` in index.js
* Adding `useAbsoluteLayout` example
* Adding `useAbsoluteLayout` in api docs
* Adding test for `useAbsoluteLayout` hook
* TypeScript updates
I've found that trying to get solid TypeScript typings for this library
are a bit of a challenge. The composable nature of the library means
that the types for the builtin functions are by their nature somewhat
minimal, and that the user needs to be able to extend those interfaces
to reflect the specific plugins that are in use.
With that in mind I propose something like this.
To get the best out of them, you then need to extend those interfaces
using declaration merging, see
https://www.typescriptlang.org/docs/handbook/declaration-merging.html
e.g.
```ts
declare module 'react-table-hooks' {
export interface TableInstance<D = any>
extends UseFiltersValues<D>,
UsePaginationValues<D>,
UseExpandedValues,
UseGroupByValues {}
export interface TableState<D = any>
extends UsePaginationState,
UseGroupByState,
UseSortbyState<D>,
UseFiltersState<D> {}
}
```
This also puts the ability to extend those types with any user defined
hooks completely in the users hands.
This gives the greatest flexibility, but I'll admit that it isn't
particularly obvious. Perhaps a typescript readme and example is needed.
* fix useExpanded type
* fix module name
* fix typo
* address review feedback
* add IdType, update Filters definition
useExpanded now uses a flat array of row path keys for tracking expanded state instead of nested
objects. This is both easier to use as a developer, but also enables expanding all rows or even
leaving nested rows in an expanded state, despite their parent rows' expanded state.
BREAKING CHANGE: See description
* Sub rows are selected if the parent row is selected.
* Parent rows are updated accordingly if a subRow is selected.
* Updated useRowSelect snapshot tests to test subRow selection.
* fix(use-sort-by): sorting now ignores column ids that no longer exist
* fix(use-filters): filtering no longer fails when column doesn't exist
* fix(use-sortby): filtering out invalid sortBys before sorting
The renderer function for headers, columns, cells, aggregates, filters, etc used to mix properties
from all of those contexts, including rows. Now thow contexts are located on their own reserved
properties, eg. `Cell: ({ cell: { value}, row, column, ...instance }) => value`
BREAKING CHANGE: The renderer function for headers, columns, cells, aggregates, filters, etc used
in case of using construction like:
```
{
defaultColumn = {}
}
```
`defaultColumn` will get new instance each time, so as result it force to recalculation each of `React.useMemo`.
* [v7] useSort - Multisort functionality: Limit `multiSort` number and configurable shift key
1. Provide configuration for multisort that pressing shift key is not compulsory
2. Configurable limit on max number of columns for multisort, like configuration has been provided that `maxMultiSortColCount` is 3, suppose currenlty table is sorted by `[A, B, C]` and then clicking `D` for sorting should result in table sorted by `[B, C , D]`
* update readme for new multisort options
* Use `isMultiSortEvent` function
so as to make `shift` key optional or take decision based on other parameters for multisorting
* `isMultiSortEvent` updated readme
v6 is now considered feature complete to its current abilities and limitations. We are not actively working to fix any issues for v6 any more. We will, however, merge any non-breaking pull requests submitted to fix anything in v6.
# Using v7?
Thanks for using the alpha version of React Table v7! We're very excited about it.
**Describe the bug**
**Describe the bug (required)**
A clear and concise description of what the bug is.
**To Reproduce**
**Provide an example via Codesandbox! (required)**
Use a new [react-table codesandbox](https://codesandbox.io/s/m5lxzzpz69) to reproduce the issue.
**Steps To Reproduce (required)**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
**Expected behavior (Recommended)**
A clear and concise description of what you expected to happen.
**Codesandbox!**
Use a new [react-table codesandbox](https://codesandbox.io/s/m5lxzzpz69) to reproduce the issue.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
-Browser [e.g. chrome, safari]
-Version [e.g. 22]
-OS: [e.g. iOS]
-Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
We do not track feature requests through Github. Please use the [Spectrum React Table Forum](https://spectrum.chat/react-table) to talk about new ideas and features.
We do not track feature requests through Github. Please use [Github Discussions](https://github.com/tannerlinsley/react-table/discussions) to talk about new ideas and features.
We do not use Github to track general support. Please use our public support forum at https://spectrum.chat/react-table.
We do not use Github to track general support. Please use our public support forum at https://github.com/tannerlinsley/react-table/discussions.
NOTE: If a support/help/question issue is opened, it will be closed immediately and be redirected to the forum. Thanks for helping us keep our issues clean and productive!
- Added the `value` property to cell renderers so that destructurin the value from the `cell` property is now not necessary. This should help with people migrating from v6 and also just to cut down on noise in cell renderers
- Fixed an issue where rollup would not build correctly
- Fixed an issue where a page index of `-1` would result in an error
## 7.0.0 🎉
- Fixed an issue where page options array could be empty
- Fixed an issue where duplicate columns would be silently deduped. There is now a warning when duplicate columns are found based on their IDs
- Moved some functions around so they will get treeshaked with their respective plugins that use them.
- Fixed an issue where filters, sorting, or grouping changes would not reset pagination
- Added table and column level options for disabling global filters
- Fixed an issue where row selection was not deselecting rows
- Fixed an issue where flex table rendering was not giving the table a minimum width with necessary
- Fixed an issue where row selection would not work when using other row-transformative plugins like filters or grouping
- Fixed an issue where header groups were not memoized correctly
## 7.0.0-rc.16
- Moved away from snapshot tests. No more testing implementation details.
- Added `visibleColumns` and `visibleColumnsDeps` hooks to manipulate columns after all data is processed. Further visibility processing may result in these columns not being visible, such as `hiddenColumn` state
- The `useRows` hook has been deprecated due to its dangerous nature 💀
- Added the `instance.rowsById` object
- Renamed `instance.flatColumns` to `instance.allColumns` which now accumulates ALL columns created for the table, visible or not.
- Added the `instance.visibleColumns` object
- Fix an issue where `useAsyncDebounce` would crash when passed arguments
- Started development on the `usePivotColumns` plugin, which can be tested currently using the `_UNSTABLE_usePivotColumns` export.
- Renamed `cell.isRepeatedValue` to `cell.isPlaceholder`
- Removed `useConsumeHookGetter` as it was inefficient most of the time and noisy
- All hooks are now "consumed" right after main plugin functions are run. This means that any attempt to add a plugin after that will result in a runtime error (for good reason, since using hook points should not be a conditional or async operation)
- Added `instance.getHooks` for getting the list of hooks that was captured after plugins are run
- Normalized all "toggle" actions to use an optional `value` property to set the value instead of toggle. Previously properties like `selected`, `groupBy`, etc. were used, but not any more!
- Undocument `instance.dispatch`. Both plugins and users should be interacting with the table via methods assigned to the instance and other structures on the table. This should both reduce the surface API that React Table needs to expose and also the amount of documentation that is needed to understand how to use the API.
-`useRowState`'s `initialRowStateAccessor` and `initialCellStateAccessor` options now have a default of `row => ({})` and `cell => ({})` respectively.
- Removed the concept of complex aggregations (eg. `column.aggregate = ['sum', 'count']`). Instead, a better aggregation function signature is now used to allow for leaf node aggregation when needed.
- Added the `column.aggregateValue` option which allows resolving (or pre-aggregating) a cell's value before it is grouped and aggregated across rows. This is useful for cell values that are not primitive, eg. an array of values that you may want to unique and count before summing that count across your groupings
- The function signature for aggregation functions has changed to be `(leafValues, aggregatedValues) => aggregatedValue` where `leafValues` is a flat array containing all leaf rows currently grouped at the aggregation level and `aggregatedValues` is an array containing the aggregated values from the immediate child sub rows. Each has purpose in the types of aggregations they power where optimizations are made for either accuracy or performance.
- Fixed an issue where `setGlobalFilter` was not a stable callback
- Added a Bootstrap UI example
- Added fixed with column support for useFlexLayout
- Fixed an issue where `manualGlobalFilter` was not resetting pagination properly
- Fixed an issue where `useGlobalFilter` could be placed after `usePagination`
- Added the sort order direction as a parameter to the sortMethod function
- Fixed an issue where user filter types were not being referenced correctly
- Renamed the `row.getExpandedToggleProps` to `row.getToggleRowExpandedProps`
- Renamed the `row.toggleExpanded` method to `row.toggleRowExpanded`
- Added the `instance.toggleRowExpanded` and `instance.toggleAllRowsExpanded` methods
- Added the `instance.getToggleAllRowsExpandedProps` prop getter
- Added the `instance.filteredRowsById` property
- Added the `instance.preFilteredRowsById` property
- useFilters now properly updates the `instance.rowsById` property
- Added the `instance.globalFilteredRowsById` property
- Added the `instance.preGlobalFilteredRowsById` property
- useGlobalFilter now properly updates the `instance.rowsById` property
- Added the `instance.nonGroupedFlatRows` property
- Added the `instance.nonGroupedRowsById` property
- Added the `instance.onlyGroupedFlatRows` property
- Added the `instance.onlyGroupedRowsById` property
- Improved the api around ensuring plugin ordering
- Added more plugin order rules to avoid strange plugin integration results
## 7.0.0-rc.15
- Added `useGlobalFilter` hook for performing table-wide filtering
- Filter function signature has changed to supply an array of column IDs (to support both the tranditional single column style and the new multi-column search style introduced with `useGlobalFilter`).
- Removed the `column` parameter from the filter function signature as it was unused and no longer made sense with the array of IDs change above.
- Updated the `filtering` example to use a global filter in addition to the column filters
## 7.0.0-rc.14
- Changed the function signature for all propGetter hooks to accept a single object of named meta properties instead of a variable length of meta arguments. The user props object has also been added as a property to all prop getters. For example, `hooks.getRowProps.push((props, instance, row) => [...])` is now written `hooks.getRowProps.push((props, { instance, row, userProps }) => [...])`
- Changed the function signature for all reduceHooks accept a single object of named meta properties instead of a variable length of meta arguments. For example, `hooks.flatColumns.push((flatColumns, instance) => flatColumns)` is now written `hooks.flatColumns.push((flatColumns, { instance }) => flatColumns)`
- Changed the function signature for all loopHooks accept a single object of named meta properties instead of a variable length of meta arguments. For example, `hooks.prepareRow.push((row, instance) => void)` is now written `hooks.prepareRow.push((row, { instance }) => void)`
## 7.0.0-rc.13
- Added the `useControlledState` hook for plugins to manipulate the final state of the table similar to how users can
- Fixed an issue where column hiding wasn't working properly.
## 7.0.0-rc.12
- Fixed an issue where removing a grouped column would result in a crash
## 7.0.0-rc.11
- Fixed an issue where plugins using the `columns` hook were not getting decorated properly
- Added back a new rendition of the `useFlexLayout` plugin and accompanying example.
- Fixed all reset actions to use the initial state passed into the table, then fall back to the default initial state for the hook
## 7.0.0-rc.10
- Optimizations made to make accessors, prop getters and other internals much faster. 10x in some cases!
- Fixed docs for `usePagination` to have `pageIndex` and `pageSize` only available on the state object, not the instance
- Added a plugin order restriction to make sure `useResizeColumns` always comes before `useAbsoluteLayout`
- Fixed the `useFinalInstance` hook to not have an empty array as the first meta argument passed.
- Fixed an issue where memoized or ref-forwarded components could not be used as cell renderers
- The `toggleExpandedById` action has been renamed to `toggleExpanded`
- Added the `toggleAllExpanded` action
- Added the `setExpanded` action
- Changed `row.isAggregated` to `row.isGrouped`
-`state.expanded` and `state.selectedRowIds` are now objects (`{[rowId]: Bool}`), not arrays. This should help with mid-to-large size datasets while also being serializable (instead of a Set(), which is not as reliable)
-`state.filters` is now an array of objects (`{id, value}`). Since filters do have order and can be applied incrementally, it should be an array to ensure correct order.
- Moved the `flatColumns` and `flatColumnsDeps` hooks to be after row/data materialization. These hooks can then manipulate the `flatColumns` object after all data has been accessed without triggering row materialization again.
- Added the `row.allCells` property and the `cellColumns` reducer hook to determine which cells to create for each row. These cells are placed into `row.allCells`. The resulting cell array is not meant to be used for display in templating and is only made available for convenience and/or advanced templating.
- Added the `cells` reducer hook to determine which cells from the `row.allCells` array that should be placed into `row.cells`. The resulting cell array is the one that is intended for display in templating.
- Reducers are now passed the actual instance variable, not the instanceRef
- Added the `makeRenderer` utility (also exported)
- Removed `column.groupByBoundary` functionality. If needed, use the `flatColumns` hook to decorate, reorganize or re-order groupBy columns
- Fixed grouped row.id's to be truly unique
## 7.0.0-rc.9
- Fixed an issue where dependency hooks were not being reduced properly, thus the table would rerender unnecessarily
- Renamed `toggleRowSelectedAll` to `toggleAllRowsSelected`. Duh...
- Added an `indeterminate` boolean prop to the default props for row selection toggle prop getters
- Renamed `selectedRowPaths` to `selectedRowIds`, which also no longer contains paths, but row IDs
- Grouped or nested row selection actions and state are now derived, instead of tracked in state.
- Rows now have a new property called `id`, which existed before and was derived from the `getRowId` option
- Rows now also have an `isSomeSelected` prop when using the `useRowSelect` hook, which denotes that at least one subRow is selected (if applicable)
- Rows' `path` property has been deprecated in favor of `id`
- Expanded state is now tracked with row IDs instead of paths
- RowState is now tracked with row IDs instead of paths
-`toggleExpandedByPath` has been renamed to `toggleExpandedById`, and thus accepts a row ID now, instead of a row path
## 7.0.0-rc.8
- Fix an issue where `useResizeColumns` would crash when using the resizer prop getter
- Fix an issue where `useBlockLayout` was clobbering props sent to headers
## 7.0.0-rc.7
Removed:
-`applyHooks` (exported but undocumented) function has been deprecated. Please use either `reduceHooks` or `loopHooks` utilities in your custom plugins now.
-`applyPropHooks` (exported but undocumented) function has been deprecated. Please use the `makePropGetter` utility in your custom plugins now.
Added:
-`reduceHooks` exported utility which is used to reduce a value through a collection of hooks. Each hook must return a value (mutation is discouraged)
-`loopHooks` exported utility which is used to loop over a collection of hooks. Hooks are not allowed to return a value (mutation is encouraged)
-`makePropGetter` exported utility which is used to create prop getters from a prop getter hook.
-`useOptions` plugin hook, which allows a plugin to reduce/modify the initial options being passed to the table
-`useFinalInstance` plugin hook, which allows a plugin access to the final table instance before it is returned to the user.
Modified:
- Prop-getter hook functions now support returning an array (in addition to the typical object of props). When an array is returned, each item in the array is smart-merged into a new props object (meaning it will intelligently compose and override styles and className)
- Prop-getter function supplied to the table have 2 new overloaded options (in addition to the typical object of props):
-`Function(props, instance, ...row/col/context) => Array<props> | props` - If a function is passed to a prop getter function, it will receive the previous props, the table instance, and potentially more context arguments. It is then be expected to return either an array of new props (to be smart-merged with styles and classes, the latest values taking priority over the previous values) or a props object (which will replace all previous props)
-`Array<props>` - If an array is passed to a prop getter function, each prop object in the array will be smart-merged with styles and classes into the props from previous hooks (with the latest values taking priority over the previous values).
- Extracted default hooks into separate file.
- Converted almost all usages of `instanceRef.current` to use `useGetLatest(instanceRef.current)` to help with avoiding memory leaks and to be more terse.
- Converted all previous prop-getter definitions to use the new `makePropGetter`
- Reorganized plugin hooks to declare as many hooks in the main plugin function as opposed to in the `useInstance` hook.
- Changed the `useInstanceBeforeDimensions` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to encourage mutation of the instance)
- Changed the `useInstance` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to encourage mutation of the instance)
- Change the `prepareRow` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to encourage mutation of the row)
## 7.0.0-rc.6
- The `columnsBeforeHeaderGroups` and `columnsBeforeHeaderGroupsDeps` hooks have been renamed to `flatColumns` and `flatColumnsDeps` respectively, which better reflects what they are used for, rather than their order, which can remain implicit.
- Added `headerGroups` and `headerGroupDeps` hooks, which, similar to `flatColumns`, allow you to decorate (and trigger) the memoized header group generation.
- Added `columns` and `columnsDeps` hooks, which, similar to `flatColumns` and `headerGroups`, allow you to decorate (and trigger) the memoized column generation/decoration.
- The new hook order is as follows: `columns/columnsDeps` => `flatColumns/flatColumnsDeps` => `headerGroups/headerGroupsDeps`
-`useColumnVisibility` now uses the new `headerGroupsDeps` hook to trigger header group regeneration when visibility changes
## 7.0.0-rc.5
- Fixed an issue where the exported `useAsyncDebounce` method would crash if its promise throw an error.
## 7.0.0-rc.4
- A maintenance release, purely intended to update the @latest tag (which was overwritten by a v6 publish)
## 7.0.0-rc.3
- Fixed an issue where `column.clearSortBy` would crash
## 7.0.0-rc.2
-`reducerHandlers` has been deprecated in favor of the new `stateReducers` hook.
- The `previousState` and `instanceRef` are now both generally available in state reducers for convenience.
- The global action property `action.instanceRef` has been deprecated.
- The `reducer` option has been renamed to `stateReducer` and in addition to passing a single reducer function now also supports passing an array of reducers
- Renamed `manualSorting` to be `manualSortBy` to be consistent with other naming conventions
- Removed the `getResetPageDeps` option in favor of the new `autoResetPage` option.
- Removed the `getResetFilterDeps` option in favor of the new `autoResetFilters` option.
- Removed the `getResetSortByDeps` option in favor of the new `autoResetSortBy` option.
- Removed the `getResetGroupByDeps` option in favor of the new `autoResetGroupBy` option.
- Removed the `getResetExpandedDeps` option in favor of the new `autoResetExpanded` option.
- Added a new exported utility called `useAsyncDebounce` to aid with external async side-effects.
- A new `useGetLatest` hook is used internally to track latest instances in a less ref-driven and verbose way.
- A new `useMountedLayoutEffect` hooks is now used internally to handle post-mount side-effects, mostly dealing with autoReset functionality
- Plugin hooks are now "consumed" using an internal `useConsumeHookGetter` hook. When they are consumed, they can no longer be manipulated past that point in the table lifecycle. This should help ensure people are using them in a relatively safe order with consistent expectations.
- Drastically "reduced" the reducer logic itself to be easier to understand and to be a stable reference for the life of the table. This change also means that the reducer must no longer be double-run/back-compared by React for changes in closure, thus actions and stateReducers (including user state reducers) will only fire once per action.
- Removed `debug` and related logging. It has been somewhat useful during development, but is now very noisy in the code. We can debug lifecycle and performance as needed from here on out.
- Removed unnecessary exports from `./utils.js` and moved all intentionally exported utilities to a new `./publicUtils.js` file.
## 7.0.0-rc.1
- Minor regex optimizations during row path creation
## 7.0.0-rc.0
- Added the support for the `Footer` renderer, `column.getFooterProps`, `footerGroups` and `footerGroup.getFooterProps`
## 7.0.0-beta.28
- Added the `useColumnVisibility` plugin as a core plugin along with several new instance and column-level methods to control column visibility
- Added the "column-hiding" example
## 7.0.0-beta.27
- Added the `useControlledState` option, which allows for hook-context control of the resolved internal table state
## 7.0.0-beta.26
- Fixed an issue where the table would crash if useSortBy was reset via the resetSortBy action
- Updated all of the examples to use the "react-table@latest" tag.
-`utils` is no longer an exported variable and instead, all of the individual util methods are exported at the root level of the library.
## 7.0.0-beta.25
- Fixed an issue where `useRowState` would crash due to invalid initial state of previous cell state on `columnId` lookup
## 7.0.0-beta.24
- Changed `selectedRowIds` to use a `Set()` instead of an array for performance.
- Removed types and related files from the repo. The community will now maintain types externally on Definitely Typed
## 7.0.0-beta.23
- The internal `useMain` hook has been renamed to `useInstance`
- The internal `useBeforeDimensions` hook has been renamed to `useInstanceBeforeDimensions`
- Fixed an issue where `useResizeColumns` wasn't working properly
## 7.0.0-beta.22
- Fixed an issue where `useRowState` would crash due to invalid initial state attempting to spread into the new state
## 7.0.0-beta.21
- Removed deprecated `defaultState` export
## 7.0.0-beta.20
- Internals have been reworked to use `useReducer` instead of `useState` for stability and architecture
- The `state` option has been removed in favor of using a custom reducer
- The `reducer` option has been changed to a new function signature: `function (newState, action, oldState) => newState`
- The `setState` table instance method is no longer supported
- The `dispatch` table instanced method was added
- The `ReactTable.actions` export is now a plain object of action types mapped to identically named action strings
- The `ReactTable.reducerHandlers` export was added, which is a plain object of plugin hook names mapped to their respective reducer functions
## 7.0.0-beta.19
- Added an `isAggregated` boolean parameter to the `aggregate` function signature
## 7.0.0-beta.16
- Removed service workers from examples
- Fixed a memory leak when `instance` was referenced in function closures
- Fixed an issue where the table would infinitely rerender due to incorrect effect dependencies
- Fixed an issue where row grouping and row selection would not work properly together.
## 7.0.0-beta.15
- Fixed an issue where `defaultGetResetPageDeps` was using `data` instead of `rows`
## 7.0.0-beta.14
- Removed
-`disablePageResetOnDataChange` option. use the `getResetPageDeps` option now.
- Added
-`getResetPageDeps` option
-`getResetFilterDeps` option
-`getResetSortByDeps` option
-`getResetGroupByDeps` option
-`getResetExpandedDeps` option
## 7.0.0-beta.13
- Added options
-`defaultCanSort`
-`defaultCanFilter`
-`defaultCanGroupBy`
-`column.defaultCanSort`
-`column.defaultCanFilter`
-`column.defaultCanGroupBy`
- Renamed
-`disableGrouping` to `disableGroupBy`
-`disableSorting` to `disableSortBy`
-`disableGroupBy` to `disableGroupBy`
-`column.disableGrouping` to `column.disableGroupBy`
-`column.disableSorting` to `column.disableSortBy`
-`column.disableGroupBy` to `column.disableGroupBy`
- Removed propType definitions. Since types are now being maintained, it makes little sense to also maintain these. Cooincidentally, this also saves some bundle size in some scenarios where they may not be removed properly by a developer's bundler.
## 7.0.0-beta.0
- Massive changes to the entire project and library. Please consult the README and documentation for more information regarding these changes.
If you have questions about implementation details, help or support, then please use our dedicated community forum at [Github Discussions](https://github.com/tannerlinsley/react-table/discussions) **PLEASE NOTE:** If you choose to instead open an issue for your question, your issue will be immediately closed and redirected to the forum.
## Reporting Issues
If you have found what you think is a bug, please [file an issue](https://github.com/tannerlinsley/react-table/issues/new). **PLEASE NOTE:** Issues that are identified as implementation questions or non-issues will be immediately closed and redirected to [Github Discussions](https://github.com/tannerlinsley/react-table/discussions)
## Suggesting new features
If you are here to suggest a feature, first create an issue if it does not already exist. From there, we will discuss use-cases for the feature and then finally discuss how it could be implemented.
## Development
If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started:
- Fork this repository
- Install dependencies by running `$ yarn`
- Link `react-table` locally by running `$ yarn link`
- Auto-build files as you edit by running `$ yarn start`
- Implement your changes and tests to files in the `src/` directory and corresponding test files
- To run examples, follow their individual directions. Usually this is just `$ yarn && yarn start`.
- To run examples using your local build, link to the local `react-table` by running `$ yarn link react-table` from the example's directory
- Document your changes in the appropriate doc page
Types for React Table are maintained externally by the Typescript community and are located at https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table.
Because React Table is not written in Typescript and the types are not maintained by the core team, there are no guarantees around the types always being up to date or working perfectly. If this is an issue for you, please contribute to the community types and discuss solutions there.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.