diff --git a/SuperGridSectionList.js b/SuperGridSectionList.js index f693db4..d66b445 100644 --- a/SuperGridSectionList.js +++ b/SuperGridSectionList.js @@ -3,6 +3,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { View, Dimensions, ViewPropTypes, SectionList } from 'react-native'; import { chunkArray } from './utils'; +import cloneDeep from 'lodash/cloneDeep'; /** * This class is a modification on the main super grid class. It renders a vertical scrolling grid SectionList @@ -110,7 +111,7 @@ class SuperGridSectionList extends Component { const { itemsPerRow } = this.state; //Deep copy, so that re-renders and chunkArray functions don't affect the actual items object - let sectionsCopy = JSON.parse(JSON.stringify(sections)); + let sectionsCopy = cloneDeep(sections); for (sectionsPair of sectionsCopy){ diff --git a/package-lock.json b/package-lock.json index 6631287..13882d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-native-super-grid", - "version": "1.1.0", + "version": "2.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -475,7 +475,7 @@ "js-yaml": "3.10.0", "json-stable-stringify": "1.0.1", "levn": "0.3.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "mkdirp": "0.5.1", "natural-compare": "1.4.0", "optionator": "0.8.2", @@ -871,7 +871,7 @@ "cli-cursor": "1.0.2", "cli-width": "2.2.0", "figures": "1.7.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "readline2": "1.0.1", "run-async": "0.1.0", "rx-lite": "3.1.2", @@ -1091,10 +1091,9 @@ } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, "lodash.cond": { "version": "4.5.2", @@ -1611,7 +1610,7 @@ "ajv": "4.11.8", "ajv-keywords": "1.5.1", "chalk": "1.1.3", - "lodash": "4.17.4", + "lodash": "4.17.10", "slice-ansi": "0.0.4", "string-width": "2.1.1" }, diff --git a/package.json b/package.json index fd0a5d4..b8664f4 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "eslint-plugin-react": "^6.10.3" }, "dependencies": { + "lodash": "^4.17.10", "prop-types": "^15.6.0" } }