Skip to content

Commit

Permalink
Bump RLV and remove invariant (#284)
Browse files Browse the repository at this point in the history
* bump RLV and remove invariant

* update change log

* fix breaking test

* test fix

Co-authored-by: Talha Naqvi <talha.naqvi@shopify.com>
  • Loading branch information
naqvitalha and naqvitalha authored Apr 4, 2022
1 parent 10bcc66 commit d73ddab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions fixture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"jestSetup.js"
],
"dependencies": {
"invariant": "^2.2.4",
"recyclerlistview": "3.1.0-alpha.9"
"recyclerlistview": "3.2.0-beta.2"
}
}
9 changes: 2 additions & 7 deletions src/__tests__/FlashList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Text>{item}</Text>;
});
Expand All @@ -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", () => {
Expand Down

0 comments on commit d73ddab

Please sign in to comment.