- 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)
Hooks for building lightweight, fast and extendable datagrids for React
Enjoy this library? Try them all! React Query, React Form, React Charts
Become a Sponsor
Features
- Lightweight (5kb - 12kb+ depending on features used and tree-shaking)
- Headless (100% customizable, Bring-your-own-UI)
- Auto out of the box, fully controllable API
- Sorting (Multi and Stable)
- Filters
- Pivoting & Aggregation
- Row Selection
- Row Expansion
- Column Ordering
- Animatable
- Virtualizable
- Resizable
- Server-side/controlled data/state
- Extensible via hook-based plugin system
Documentation
- Installation - Walk through how to install React Table
- Concepts - Read how React Table works and how you can use it better
- Examples - Experience and learn from some examples and guides of how to use React Table and implement common patterns
- API - Get to know React Table's API
- FAQ - Learn how to use React Table for specific challenges and tasks
- Previous Versions
- Contributing - Become familiar with how to contribute back to React Table
- Code of Conduct - Be a good React Table citizen by following these repository rules
Sponsors
This library is being built and maintained by me, @tannerlinsley and I am always in need of more support to keep this project afloat. If you would like to get additional support, add your logo or name on this README, or simply just contribute to my open source Sponsorship goal, visit my Github Sponsors page!
|
Become a Sponsor! |
|
|
|
Become a Sponsor! |
|
|
|
Become a Sponsor! |
|
Become a Sponsor! |
|
|
Become a Supporter! |
|
|
Become a Fan! |
Become a Sponsor
Previous Versions
Version 6
v6 is a great library and while it is still available to install and use, I am no longer offering any long-term support for it. If you intend to keep using v6, I recommend maintaining your own fork of the library and keeping it up to date for your version of React.
Where are the docs for the older v6 version?
Please visit the v6 branch
I want to migrate from v6 to v7. How do I do that?
The differences between the 2 versions are incredibly massive. Unfortunately, I cannot write a one-to-one upgrade guide for any of v6's API, simply because much of it is irrelevant with v7's headless approach. The best approach for migrating to v7 is to learn its API by reading the documentation and then following some of the examples to begin building your own table component.
In case you would need to have both v6 and v7 in one app during the migration process (large codebase, complex use cases), you can either (1) fork and maintain your own local version of React Table v6 or (2) install the react-table-6 alias package for use alongside the react-table package.
