From 8ef45e6cbeefa4336cf73ded5330dfa959137579 Mon Sep 17 00:00:00 2001 From: Wojciech Kwiatek Date: Thu, 5 Sep 2019 14:59:47 +0200 Subject: [PATCH 1/5] Use deprecated listView from separated package due to its removal in RN 0.60 --- components/SelectableSectionsListView.js | 2 +- package-lock.json | 68 ++++++++++++++++++------ package.json | 1 + 3 files changed, 53 insertions(+), 18 deletions(-) diff --git a/components/SelectableSectionsListView.js b/components/SelectableSectionsListView.js index 01d1e2a..d4980bb 100644 --- a/components/SelectableSectionsListView.js +++ b/components/SelectableSectionsListView.js @@ -4,11 +4,11 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReactNative, { - ListView, StyleSheet, View, NativeModules, } from 'react-native'; +import ListView from 'deprecated-react-native-listview'; import merge from 'merge'; import SectionHeader from './SectionHeader'; diff --git a/package-lock.json b/package-lock.json index 3fde5fb..56feb35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,12 +14,33 @@ "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" }, + "create-react-class": { + "version": "15.6.3", + "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", + "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", + "requires": { + "fbjs": "^0.8.9", + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" + } + }, + "deprecated-react-native-listview": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/deprecated-react-native-listview/-/deprecated-react-native-listview-0.0.5.tgz", + "integrity": "sha512-Cy7nDdd+KU+nR3tY1BSMuoZpsYC6OVSZyAiUSTDBop2lIgzCseDx7XI57x6h+NXer/8aor2yiQDQfeFcmBMwgQ==", + "requires": { + "create-react-class": "*", + "fbjs": "*", + "invariant": "*", + "react-clone-referenced-element": "*" + } + }, "encoding": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "requires": { - "iconv-lite": "0.4.19" + "iconv-lite": "~0.4.13" } }, "fbjs": { @@ -27,13 +48,13 @@ "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", "requires": { - "core-js": "1.2.7", - "isomorphic-fetch": "2.2.1", - "loose-envify": "1.3.1", - "object-assign": "4.1.1", - "promise": "7.3.1", - "setimmediate": "1.0.5", - "ua-parser-js": "0.7.17" + "core-js": "^1.0.0", + "isomorphic-fetch": "^2.1.1", + "loose-envify": "^1.0.0", + "object-assign": "^4.1.0", + "promise": "^7.1.1", + "setimmediate": "^1.0.5", + "ua-parser-js": "^0.7.9" } }, "iconv-lite": { @@ -41,6 +62,14 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -51,8 +80,8 @@ "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", "requires": { - "node-fetch": "1.7.3", - "whatwg-fetch": "2.0.3" + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" } }, "js-tokens": { @@ -65,7 +94,7 @@ "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", "requires": { - "js-tokens": "3.0.2" + "js-tokens": "^3.0.0" } }, "node-fetch": { @@ -73,8 +102,8 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", "requires": { - "encoding": "0.1.12", - "is-stream": "1.1.0" + "encoding": "^0.1.11", + "is-stream": "^1.0.1" } }, "object-assign": { @@ -87,7 +116,7 @@ "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "requires": { - "asap": "2.0.6" + "asap": "~2.0.3" } }, "prop-types": { @@ -95,11 +124,16 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.0.tgz", "integrity": "sha1-zq8IMCL8RrSjX2nhPvda7Q1jmFY=", "requires": { - "fbjs": "0.8.16", - "loose-envify": "1.3.1", - "object-assign": "4.1.1" + "fbjs": "^0.8.16", + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" } }, + "react-clone-referenced-element": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/react-clone-referenced-element/-/react-clone-referenced-element-1.1.0.tgz", + "integrity": "sha512-FKOsfKbBkPxYE8576EM6uAfHC4rnMpLyH6/TJUL4WcHUEB3EUn8AxPjnnV/IiwSSzsClvHYK+sDELKN/EJ0WYg==" + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", diff --git a/package.json b/package.json index d4b6fcb..2ca4971 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "android" ], "dependencies": { + "deprecated-react-native-listview": "0.0.5", "merge": "^1.2.0", "prop-types": "^15.6.0" } From 564b75d4701b68b2e4d8e33cbbcad3c01285e023 Mon Sep 17 00:00:00 2001 From: Wojciech Kwiatek Date: Tue, 10 Nov 2020 22:29:49 +0100 Subject: [PATCH 2/5] Update deprecated-react-native-listview to 0.0.6 for React Native 0.62 compatibility --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ca4971..3918c80 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "android" ], "dependencies": { - "deprecated-react-native-listview": "0.0.5", + "deprecated-react-native-listview": "0.0.6", "merge": "^1.2.0", "prop-types": "^15.6.0" } From 8c7641ec46d443ae15830e36840bc6d712fdaa64 Mon Sep 17 00:00:00 2001 From: Wojciech Kwiatek Date: Tue, 30 Mar 2021 18:12:35 +0200 Subject: [PATCH 3/5] Update names of removed methods for React 17 compatibility --- components/SectionList.js | 2 +- components/SelectableSectionsListView.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/SectionList.js b/components/SectionList.js index e220cd9..85bafa3 100644 --- a/components/SectionList.js +++ b/components/SectionList.js @@ -93,7 +93,7 @@ export default class SectionList extends Component { this.fixSectionItemMeasure(); } - componentWillUnmount() { + UNSAFE_componentWillUnmount() { this.measureTimer && clearTimeout(this.measureTimer); } diff --git a/components/SelectableSectionsListView.js b/components/SelectableSectionsListView.js index d4980bb..2553c01 100644 --- a/components/SelectableSectionsListView.js +++ b/components/SelectableSectionsListView.js @@ -47,7 +47,7 @@ export default class SelectableSectionsListView extends Component { this.updateTagInSectionMap = this.updateTagInSectionMap.bind(this); } - componentWillMount() { + UNSAFE_componentWillMount() { this.calculateTotalHeight(); } @@ -63,7 +63,7 @@ export default class SelectableSectionsListView extends Component { }, 0); } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { if (nextProps.data && nextProps.data !== this.props.data) { this.calculateTotalHeight(nextProps.data); } From c8a3ff76c5d4d1a6c15e8acb95bfb2819326ede7 Mon Sep 17 00:00:00 2001 From: Wojciech Kwiatek Date: Wed, 4 Aug 2021 13:04:38 +0200 Subject: [PATCH 4/5] Update deprecated-react-native-listview --- package-lock.json | 19 +++++++++---------- package.json | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 56feb35..d1f1c85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,19 +15,18 @@ "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" }, "create-react-class": { - "version": "15.6.3", - "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", - "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.7.0.tgz", + "integrity": "sha512-QZv4sFWG9S5RUvkTYWbflxeZX+JG7Cz0Tn33rQBJ+WFQTqTfUTjMjiv9tnfXazjsO5r0KhPs+AqCjyrQX6h2ng==", "requires": { - "fbjs": "^0.8.9", "loose-envify": "^1.3.1", "object-assign": "^4.1.1" } }, "deprecated-react-native-listview": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/deprecated-react-native-listview/-/deprecated-react-native-listview-0.0.5.tgz", - "integrity": "sha512-Cy7nDdd+KU+nR3tY1BSMuoZpsYC6OVSZyAiUSTDBop2lIgzCseDx7XI57x6h+NXer/8aor2yiQDQfeFcmBMwgQ==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/deprecated-react-native-listview/-/deprecated-react-native-listview-0.0.7.tgz", + "integrity": "sha512-l0lWjpU70MlHF0Sy/xi1I6vQkb5tatXKag5iSbXmEKh9g8ZqUbdlP9wGTy5g3GQc5qqaUYAf6mIY5CtkN5BStQ==", "requires": { "create-react-class": "*", "fbjs": "*", @@ -130,9 +129,9 @@ } }, "react-clone-referenced-element": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/react-clone-referenced-element/-/react-clone-referenced-element-1.1.0.tgz", - "integrity": "sha512-FKOsfKbBkPxYE8576EM6uAfHC4rnMpLyH6/TJUL4WcHUEB3EUn8AxPjnnV/IiwSSzsClvHYK+sDELKN/EJ0WYg==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/react-clone-referenced-element/-/react-clone-referenced-element-1.1.1.tgz", + "integrity": "sha512-LZBPvQV8W0B5dFzXFu+D3Tpil8YHS8tO00iFsfXcTLdtpuH7XyvaHqHcoz4hd4uNPQCZ30fceh+s7mLznzMXvg==" }, "setimmediate": { "version": "1.0.5", diff --git a/package.json b/package.json index 3918c80..c2de686 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "android" ], "dependencies": { - "deprecated-react-native-listview": "0.0.6", + "deprecated-react-native-listview": "0.0.7", "merge": "^1.2.0", "prop-types": "^15.6.0" } From 8b76e2c5ad261752ec427ff36f5ebec6f006e738 Mon Sep 17 00:00:00 2001 From: Wojciech Kwiatek Date: Mon, 16 Aug 2021 16:12:38 +0200 Subject: [PATCH 5/5] Fix undefined measure data on Android --- components/SectionList.js | 29 +++++++++++++++++++++-------- package.json | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/components/SectionList.js b/components/SectionList.js index 85bafa3..325f9f6 100644 --- a/components/SectionList.js +++ b/components/SectionList.js @@ -7,6 +7,7 @@ import ReactNative, { View, Text, NativeModules, + Platform, } from 'react-native'; const { UIManager } = NativeModules; @@ -73,14 +74,26 @@ export default class SectionList extends Component { return; } this.measureTimer = setTimeout(() => { - sectionItem.measure((x, y, width, height, pageX, pageY) => { - //console.log([x, y, width, height, pageX, pageY]); - this.measure = { - y: pageY, - width, - height - }; - }) + if (Platform.OS === 'android') { + sectionItem.measureInWindow((x, y, width, height, pageX, pageY) => { + //console.log([x, y, width, height, pageX, pageY]); + this.measure = { + y: pageY, + width, + height + }; + }) + } + else { + sectionItem.measure((x, y, width, height, pageX, pageY) => { + //console.log([x, y, width, height, pageX, pageY]); + this.measure = { + y: pageY, + width, + height + }; + }) + } }, 0); } diff --git a/package.json b/package.json index c2de686..2b1b0f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-alphabetlistview", - "version": "0.3.0", + "version": "0.3.1", "description": "A Listview with a sidebar to jump to sections directly, based on johanneslumpe's react-native-selectablesectionlistview", "main": "index.js", "scripts": {