![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
react-table-hoc-fixed-columns
Advanced tools
Higher Order Components for ReactTable. It make possible to fixed 1 or more columns.
npm install react-table-hoc-fixed-columns --save
It's really simple: add fixed
property to your columns:
import ReactTable from 'react-table';
import createTable from 'react-table-hoc-fixed-columns';
const ReactTableFixedColumns = createTable(ReactTable);
...
render () {
return (
<ReactTableFixedColumns
data={data}
columns={[
{
Header: 'First Name',
accessor: 'firstName',
fixed: true,
},
{
Header: 'Last Name',
accessor: 'lastName',
fixed: true,
},
{
Header: 'age',
accessor: 'age',
},
{
Header: 'other',
columns: [
...
]
},
]}
/>
)
}
Notes:
It's a workaround, because the main ReactTable
package currently not provide a way to have fixed columns.
animation is not always smooth, it depend on your browser, OS, and scroll trigger (mouse wheel or scroll bar), but it works.
fixed columns must be placed a the index 0
fixed columns cannot be placed in a group
fixed columns are resizable
fixed columns must have a hardcoded width
, by default it's 150
If you need to access ReactTable ref, use innerRef
:
render () {
return (
<ReactTableFixedColumns
innerRef={(ref) => { this.tableRef = ref; }}
/>
)
}
Follow these steps to get started developing :
git clone https://github.com/guillaumejasmin/react-table-hoc-fixed-columns.git
npm install
npm run lib:watch
- Transpile the src/lib
folder in watch modenpm run docs
- start a development server with the demo website based on the src/docs
folder.FAQs
ReactTable HOC for fixed columns
The npm package react-table-hoc-fixed-columns receives a total of 12,704 weekly downloads. As such, react-table-hoc-fixed-columns popularity was classified as popular.
We found that react-table-hoc-fixed-columns demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.