diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b477ad2..5f9a612ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,12 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] - Reduce number of render item calls + - https://github.com/Shopify/flash-list/pull/253 +- Upgrade recyclerlistview to v3.2.0-beta.2 + - https://github.com/Shopify/flash-list/pull/284 + ## [0.4.1] - 2022-03-29 - Crash fix for android activity switching (#256) diff --git a/fixture/package.json b/fixture/package.json index 1dfbb951f..6224003ac 100644 --- a/fixture/package.json +++ b/fixture/package.json @@ -25,8 +25,7 @@ "react-native-gesture-handler": "^2.3.2", "react-native-reanimated": "^2.4.1", "react-native-safe-area-context": "^3.3.2", - "react-native-screens": "^3.13.1", - "recyclerlistview": "3.1.0-alpha.9" + "react-native-screens": "^3.13.1" }, "devDependencies": { "babel-jest": "^27.5.1", diff --git a/package.json b/package.json index 0f443a02a..7fd0abaf8 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "jestSetup.js" ], "dependencies": { - "invariant": "^2.2.4", - "recyclerlistview": "3.1.0-alpha.9" + "recyclerlistview": "3.2.0-beta.2" } } diff --git a/src/__tests__/FlashList.test.tsx b/src/__tests__/FlashList.test.tsx index 7e9b7b0e7..e6de4bfd0 100644 --- a/src/__tests__/FlashList.test.tsx +++ b/src/__tests__/FlashList.test.tsx @@ -115,7 +115,7 @@ describe("FlashList", () => { expect(autoLayoutView.props.onBlankAreaEvent).not.toBeUndefined(); }); - it("calls render item only when data of the items has changed", (done) => { + it("calls render item only when data of the items has changed", () => { const renderItemMock = jest.fn(({ item }) => { return {item}; }); @@ -132,12 +132,7 @@ describe("FlashList", () => { flashList.setProps({ numColumns: 2 }); // render item should be called 0 times because only layout of items would have changed expect(renderItemMock).toHaveBeenCalledTimes(0); - - // There's some async operation happening inside the scroll component causing jest to throw errors - // This is a workaround to silence it. - requestAnimationFrame(() => { - done(); - }); + flashList.unmount(); }); it("keeps component mounted based on prepareForLayoutAnimationRender being called", () => {