Skip to content
Permalink
Browse files

v6.8.6

  • Loading branch information...
tannerlinsley committed May 24, 2018
1 parent 24a9efd commit fcdc3d88bc8848ca18c66c9383f1772e5e28f8d1
Showing with 170 additions and 190 deletions.
  1. +12 −0 CHANGELOG.md
  2. +2 −2 README.md
  3. +1 −1 package.json
  4. +2 −2 src/lifecycle.js
  5. +11 −2 src/methods.js
  6. +1 −1 src/propTypes.js
  7. +141 −182 yarn.lock
@@ -1,3 +1,15 @@
## 6.8.6

#### Fixes & Optimizations

* Since `resolveData` is now capable of materializing data on it's own, the `data` prop is no longer required as a prop-type.

## 6.8.4

#### Fixes & Optimizations

* Only run `resolveData` prop when `data` prop has changed, not any others.

## 6.8.3

#### Fixes & Optimizations
@@ -12,8 +12,8 @@
<a href="https://npmjs.com/package/react-table" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/react-table.svg" />
</a>
<a href="https://react-chat-signup.herokuapp.com/" target="\_parent">
<img alt="" src="https://img.shields.io/badge/slack-react--chat-blue.svg" />
<a href="https://spectrum.chat/react-table">
<img alt="Join the community on Spectrum" src="https://withspectrum.github.io/badge/badge.svg" />
</a>
<a href="https://github.com/react-tools/react-table" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/react-tools/react-table.svg?style=social&label=Star" />
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "6.8.5",
"version": "6.8.6",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/react-tools/react-table#readme",
@@ -1,7 +1,7 @@
export default Base =>
class extends Base {
componentWillMount () {
this.setStateWithData(this.getDataModel(this.getResolvedState()))
this.setStateWithData(this.getDataModel(this.getResolvedState(), true))
}

componentDidMount () {
@@ -44,7 +44,7 @@ export default Base =>
oldState.sorted !== newState.sorted ||
oldState.filtered !== newState.filtered
) {
this.setStateWithData(this.getDataModel(newState))
this.setStateWithData(this.getDataModel(newState, oldState.data !== newState.data))
}
}

@@ -13,7 +13,7 @@ export default Base =>
return resolvedState
}

getDataModel (newState) {
getDataModel (newState, dataChanged) {
const {
columns,
pivotBy = [],
@@ -238,7 +238,16 @@ export default Base =>
}
return row
}
let resolvedData = resolveData(data).map((d, i) => accessRow(d, i))

// // If the data hasn't changed, just use the cached data
let resolvedData = this.resolvedData
// If the data has changed, run the data resolver and cache the result
if (!this.resolvedData || dataChanged) {
resolvedData = resolveData(data)
this.resolvedData = resolvedData
}
// Use the resolved data
resolvedData = resolvedData.map((d, i) => accessRow(d, i))

// TODO: Make it possible to fabricate nested rows without pivoting
const aggregatingColumns = allVisibleColumns.filter(d => !d.expander && d.aggregate)
@@ -2,7 +2,7 @@ import PropTypes from 'prop-types'

export default {
// General
data: PropTypes.any.isRequired,
data: PropTypes.any,
loading: PropTypes.bool,
showPagination: PropTypes.bool,
showPaginationTop: PropTypes.bool,
Oops, something went wrong.

1 comment on commit fcdc3d8

@prmichaelsen

This comment has been minimized.

Copy link

prmichaelsen commented on fcdc3d8 Jul 19, 2018

awesome, thanks

Please sign in to comment.
You can’t perform that action at this time.