Lightweight grid framework built on top of react-virtualized / fixed-data-table for easy highly customizable grids generated from redux state.
npm install redux-gridnpm i -S redux-grid
js
import React from 'react'
import { connect } from 'react-redux'
import ReactVirtualized from 'react-virtualized'
import { createGrid } from 'redux-grid'
const { Grid } = createGrid({ React, connect, ReactVirtualized })
/* Create a grid to show users first name, last name, and age from redux /
export default props => (
mapCols={
/* Map redux state to object with column name keys and header component values /
state => ({ first: First Name
, last: Last Name
, age: { render: Age, width: 100 }
})
}
mapRows={
/* Map redux state to grid rows. /
state => state.users.map(x => [x.first, x.last, x.age])
}
/>
)
``