Comparing version 1.0.2 to 1.0.3
@@ -159,5 +159,9 @@ 'use strict'; | ||
for (let index = 0; index < this.positionCache.getSize(); index++) { | ||
const height = prevPositioner.get(index).height; | ||
const item = this.itemPositioner.set(index, height); | ||
nextPositionCache.setPosition(index, item.left, item.top, height); | ||
const pos = prevPositioner.get(index); | ||
if (pos !== void 0) { | ||
const height = prevPositioner.get(index).height; | ||
const item = this.itemPositioner.set(index, height); | ||
nextPositionCache.setPosition(index, item.left, item.top, height); | ||
} | ||
} | ||
@@ -164,0 +168,0 @@ |
@@ -121,5 +121,9 @@ function _extends() { | ||
for (let index = 0; index < this.positionCache.getSize(); index++) { | ||
const height = prevPositioner.get(index).height; | ||
const item = this.itemPositioner.set(index, height); | ||
nextPositionCache.setPosition(index, item.left, item.top, height); | ||
const pos = prevPositioner.get(index); | ||
if (pos !== void 0) { | ||
const height = prevPositioner.get(index).height; | ||
const item = this.itemPositioner.set(index, height); | ||
nextPositionCache.setPosition(index, item.left, item.top, height); | ||
} | ||
} | ||
@@ -126,0 +130,0 @@ |
{ | ||
"name": "masonic", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A React virtualized masonry component for the window based on the original by Brian Vaughn", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -38,10 +38,4 @@ # Masonic | ||
const CoolMasonryComponent = props => ( | ||
<Masonry | ||
items={items} | ||
columnWidth={240} | ||
columnGutter={16} | ||
itemHeightEstimate={160} | ||
itemKey={data => data.id} | ||
> | ||
const EasyMasonryComponent = props => ( | ||
<Masonry items={items}> | ||
{({index, data, width}) => ( | ||
@@ -333,2 +327,2 @@ <div> | ||
- Mikola Lysenko for his [`binary-search-bounds`](https://github.com/mikolalysenko/binary-search-bounds) | ||
and [`interval-tree-1d`](https://github.com/mikolalysenko/interval-tree-1d) | ||
and [`interval-tree-1d`](https://github.com/mikolalysenko/interval-tree-1d) |
@@ -148,5 +148,9 @@ import React, {useCallback, useMemo, useEffect, useRef} from 'react' | ||
for (let index = 0; index < this.positionCache.getSize(); index++) { | ||
const height = prevPositioner.get(index).height | ||
const item = this.itemPositioner.set(index, height) | ||
nextPositionCache.setPosition(index, item.left, item.top, height) | ||
const pos = prevPositioner.get(index) | ||
if (pos !== void 0) { | ||
const height = prevPositioner.get(index).height | ||
const item = this.itemPositioner.set(index, height) | ||
nextPositionCache.setPosition(index, item.left, item.top, height) | ||
} | ||
} | ||
@@ -153,0 +157,0 @@ |
Sorry, the diff of this file is not supported yet
174508
4382
327