Граф коммитов

241 Коммитов

Автор SHA1 Сообщение Дата
David Vacca 5eac8ca9b0 Migrate VirtualizedList to use ref.measureLayout
Summary: This diff migrates VirtualizedList to use ref.measureLayout instead of UIManager.measureLayout, this is a pre-req to make measureLayout to work in Fabric

Reviewed By: JoshuaGross, TheSavior

Differential Revision: D14865762

fbshipit-source-id: 45dd3374813370188c914acfc7e631075508f74a
2019-04-30 15:05:02 -07:00
Spencer Ahrens e4392b773c Fix tail spinner disapearing before new content being loaded
Reviewed By: larrylin28

Differential Revision: D14990884

fbshipit-source-id: 601ef618c6dda7e58abee57241de3c0edd528915
2019-04-23 16:03:44 -07:00
Spencer Ahrens 88787b5e7a Fix infinite `setState` in `VirtualizedList`
Reviewed By: larrylin28

Differential Revision: D14990686

fbshipit-source-id: 632fa0e4e11feff9dcfb4ac62ba8bc7a6c0393a5
2019-04-23 16:03:44 -07:00
Jérémy M 1946aee3d9 - Externalise and handle any sort of data blob (#20787)
Summary:
Fixes #20770
Pull Request resolved: https://github.com/facebook/react-native/pull/20787

Reviewed By: sahrens

Differential Revision: D9485598

Pulled By: cpojer

fbshipit-source-id: edddebf6b5e1ca396ab1a519baf019c1e5188d44
2019-04-18 11:55:43 -07:00
Spencer Ahrens efe6a0f0b5 make sure onLayout calls _updateViewableItems immediately
Summary:
Makes sure `onViewableItemsChanged` fires ASAP when `waitForInterations` is false.

This also works around another deeper bug where updates scheduled with `InteractionManager` aren't firing at all in some cases, and thus instead of just firing late, `onViewableItemsChanged` isn't firing until scroll which is not what we want with `waitForInterations: false`. That bug will require more digging.

Differential Revision: D14984333

fbshipit-source-id: 718b39670307c6bc16268759bdb513682745265d
2019-04-17 14:27:17 -07:00
Logan Daniels c46ca60e3f Make FlatList's renderItem return React.Node
Summary:
Flow typing can be annoying because the `renderItem` prop for FlatList always has to specifically be of type `React.Element`.

Since really we just want to return something renderable, it should be fine to type this as `React.Node` instead.

I'm not sure if this is valid, but it seems like since we just need to implant the `key` property, we should be able to accomplish this with a `React.Fragment` wrapper instead of needing to call `cloneElement`. Looking for feedback on if this is a sensible fix.

Changelog:
[General][Changed] Updated FlatList's renderItem Flow type from React.Element<any> to React.Node

Reviewed By: sahrens

Differential Revision: D14814805

fbshipit-source-id: ce6793dea5a92619babe048dcfddee0e4519979c
2019-04-08 12:55:09 -07:00
AntoineDoubovetzky 4627644450 Remove wrapper around ListEmptyComponent (#24339)
Summary:
This pull request fixes #24257.

The wrapper around ListEmptyComponent doesn't allow to use flex on the ListEmptyComponent.
The wrapper was removed in this [commit](db061ea8c7), and then put back in this [commit](e94d3444dc) but I think the relevant part was removing the condition on `itemCount !== 0` to apply the inversionStyle on the ScrollView and everything is still working without the wrapper.

[GENERAL] [FIXED] - Remove wrapper around ListEmptyComponent
Pull Request resolved: https://github.com/facebook/react-native/pull/24339

Differential Revision: D14822221

Pulled By: cpojer

fbshipit-source-id: 623e1ab3f228e9b75b92cdcd568683232a403c1a
2019-04-08 12:49:55 -07:00
MoOx e980d83389 - VirtualizedSectionList/SectionList: replace enableVirtualization prop annotation by correct underlying disableVirtualisation of VirtualizedList (#24312)
Summary:
It seems (I used git history to confirm) that FlatList/VirtualizedList have ([since the begining](c13f5d48cf/Libraries/Lists/VirtualizedList.js (L79))) a `disableVirtualization` prop.
SectionList ([since it's begining](abe737fe74/Libraries/Lists/VirtualizedSectionList.js (L98))) have a `enableVirtualization` prop, but since SectionList is VirtualizedSectionList which use VirtualizedList, this prop probably never did something. This fix just rename the prop properly so it can have an effect on the underlying VirtualizedList when you use a SectionList.

Since props are spread it's kind of working already, but the flow annotation are wrong (so it tells you it won't work/ you can't use it) which sucks.

(NB: I am doing this since I was trying to use a SectionList with react-native-web & server side rendering to get the all list, you can laugh).

[General] [Fixed] - VirtualizedSectionList/SectionList: replace enableVirtualization prop annotation by correct underlying disableVirtualisation of VirtualizedList
Pull Request resolved: https://github.com/facebook/react-native/pull/24312

Differential Revision: D14779449

Pulled By: cpojer

fbshipit-source-id: e51e1d639d2bb265b5b286786010d01ffd9d90e0
2019-04-04 14:32:39 -07:00
michalchudziak c13f5d48cf Fix behaviour of Header, Footer and Empty List components in VirtualizedList when it's inverted (#24167)
Summary:
Fixes https://github.com/facebook/react-native/issues/23453
Fixes https://github.com/facebook/react-native/issues/21196

Basically, changes made in https://github.com/facebook/react-native/pull/21496 currently breaks behavior of `<VirtualizedList />`  and any components that are based on it (`<SectionList />, <FlatList />`). This PR solves both issues listed above.

Visual confirmation of the resolved issue:

**Vertical, not inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55076839-b005d700-5096-11e9-91de-090934cb0129.png)

**Vertical, not inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55076971-fb1fea00-5096-11e9-8d73-5a2d86275da8.png)

**Vertical, inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55077042-23a7e400-5097-11e9-911f-9dad4d48a578.png)

**Vertical, inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55079957-87351000-509d-11e9-8f1c-b7134f1f43f9.png)

**Horizontal, not inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55077118-44703980-5097-11e9-94e9-e33d4af436ee.png)

**Horizontal, not inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55077150-52be5580-5097-11e9-9d43-7cb4e983167e.png)

**Horizontal, inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55077183-623d9e80-5097-11e9-9e8a-1b2468c7b3a9.png)

**Horizontal, inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55080033-af247380-509d-11e9-90ae-1ff656d46dd1.png)

[General] [Fixed] - Fixed VirtualizedList, SectionList and FlatList behavior on rendering list headers with inverted prop and zero items
Pull Request resolved: https://github.com/facebook/react-native/pull/24167

Differential Revision: D14642345

Pulled By: cpojer

fbshipit-source-id: b530bbbd57f60e53a976ac5db272ea4b2d2b3e99
2019-03-27 12:02:41 -07:00
Bartol Karuza 02e8e531dd Fix #24053 prevent division by zero error in VirtualizedList debug overlay (#24058)
Summary:
This PR fixes the case where the content a VirtualizedList loads with a contentLength of 0,  causing a crash in the `renderDebugOverlay` function. The result of that crash is a red screen when turning on debug on FlatList and other VirtualizedList components as described in #24053.

[LIST] [FIX] - Fix VirtualizedList debug mode crash
Pull Request resolved: https://github.com/facebook/react-native/pull/24058

Differential Revision: D14538317

Pulled By: cpojer

fbshipit-source-id: 7b17bf51c388561c517bab1f775a31200abdc5a9
2019-03-20 01:48:25 -07:00
Danilo Bürger 8fa116cc0e Fixed regression in SectionList caused by #21577 not being able to scroll to top on android (#24034)
Summary:
```
let index = params.itemIndex + 1;
```
to
```
let index = Platform.OS === 'ios' ? params.itemIndex : params.itemIndex - 1;
```
to fix an issue on iOS. Note however, how the sign for non iOS changed from `+` to `-` causing a crash on Android when trying to scroll to index 0 as that will be evaluated to -1 instead of 1 and thus be out of bounds.

[Android] [Fixed] - Fixed regression in SectionList caused by #21577 not being able to scroll to top on android
Pull Request resolved: https://github.com/facebook/react-native/pull/24034

Differential Revision: D14520796

Pulled By: cpojer

fbshipit-source-id: bb49619f49752fd3f343ef3b7bf1b86ac48af7f8
2019-03-19 07:32:20 -07:00
Peter van der Zee dcd4e90d9a Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 07:00:27 -07:00
George Zahariev 35d2dfcabf Deploy 0.94 to xplat
Summary:
Update Flow version in xplat (https://our.intern.facebook.com/intern/wiki/Flow/Flow_Release_Process/#update-xplat-js)

allow-large-files
bypass-lint

Reviewed By: nmote

Differential Revision: D14317820

fbshipit-source-id: 07ec22c0745321db036f4e10a502009a4b640652
2019-03-06 14:57:30 -08:00
Vojtech Novak 929908f287 make sure to check array bounds in VirtualizedSectionList (#23710)
Summary:
SectionList accesses items outside of the array bounds.

This was discovered when using mobx, which warns you: `[mobx.array] Attempt to read an array index (${index}) that is out of bounds`. This is because `section.data[itemIndex + 1]` goes beyond array length.

This PR adds an array length check and simplifies the code a bit to avoid repetitive `this.props.`
Pull Request resolved: https://github.com/facebook/react-native/pull/23710

Differential Revision: D14298557

Pulled By: cpojer

fbshipit-source-id: fee3422ad5b053d91a097c5842f46e78a149c3d5
2019-03-03 20:34:37 -08:00
Christoph Nakazawa 14d9b2d68d Remove ListView and SwipeableListView from React Native
Summary:
This diff removes ListView and SwipeableListView from React Native:
* Removes the code and all examples
* Removes the exports on `react-native-implementation` but leaves an error message in dev mode only
* Uses `deprecated-react-native-listview` for `ListView` and `deprecated-react-native-swipeable-listview` for `SwipeableListView`

Both ListView and SwipeableListView are now fully removed from React Native in open source and we will continue to use the deprecated packages internally.

Reviewed By: TheSavior

Differential Revision: D14181708

fbshipit-source-id: 5030c33791f998567de058fee934449c16fa1d54
2019-02-25 22:40:10 -08:00
Daniel Sainati 8da1f1149f deploy 0.93
Summary:
upgrades flow version

allow-large-files
bypass-lint

Reviewed By: nmote

Differential Revision: D14095305

fbshipit-source-id: 000b3b2e085f673bc443fc8bc1b3aae1b42df0e9
2019-02-15 12:04:32 -08:00
Danilo Bürger e4fd9babe0 Fix regression of VirtualizedList jumpy header (#22025)
Summary:
Fixes #20956, #21361, #21198, #21468
Keeps the intended outcome of #18105
Pull Request resolved: https://github.com/facebook/react-native/pull/22025

Differential Revision: D13941915

Pulled By: cpojer

fbshipit-source-id: 59a0a834ea2d0dd4678e80a82ddaf95cecf87d38
2019-02-04 08:20:15 -08:00
Albert Sun ec9fe48819 Back out "[react-native][PR] [fix] Fixing overscrolling issue on Virtualized List"
Summary:
Reverting this change since it broke some initial scroll positions. It seems the proper API to use to limit overscrolling should be overScrollMode='never'

Original commit changeset: 2ec5787218ec

Reviewed By: olegbl

Differential Revision: D13845053

fbshipit-source-id: 673aa529ef5171f26ce138573ee36f31f5d9799e
2019-01-28 11:55:32 -08:00
Dustin Savery 4d5f85ed42 Fixing overscrolling issue on Virtualized List (#23181)
Summary:
Changelog:
----------
[iOS][fixed] Fixed overscroll behavior on iOS virtualized lists (Fixes #18098)
Pull Request resolved: https://github.com/facebook/react-native/pull/23181

Differential Revision: D13838579

Pulled By: cpojer

fbshipit-source-id: 2ec5787218ecca0e01aaf31bfbb7d630cf9f1f09
2019-01-28 03:26:12 -08:00
Christoph Nakazawa f66e8ebf51 Fixes #issue18098 SectionList scrollToLocation (#21577)
Summary:
Fixes #18098
Pull Request resolved: https://github.com/facebook/react-native/pull/21577

Differential Revision: D13761884

Pulled By: cpojer

fbshipit-source-id: a096d69c589815d00754427fb575de0d8d0b595f
2019-01-22 07:27:10 -08:00
seansy e011c4c0e2 Fixes 'Invalid render range' crash (#22847)
Summary:
When a list is updated to have fewer items and the user immediately
scrolls, the `ViewabilityHelper` `computeViewableItems` can be invoked
from the scroll and cause a crash.

This side effect *should* be relatively minor; the ViewabilityHelper shouldn't
cause a crash, as it generally would be used for analytics to see what users are viewing. I suggest changing this to a warning instead of a crash.  Other react-native developers seem to [also be getting this occasionally](https://github.com/facebook/react-native/issues/20289).

Changelog:
----------

[General] [Fixed] - `Invalid render range` crash changed to warning when viewability helper detects an anomaly in list data.
Pull Request resolved: https://github.com/facebook/react-native/pull/22847

Differential Revision: D13750031

Pulled By: cpojer

fbshipit-source-id: 053d2baad208d1efe5b18b07ab10226032e665b8
2019-01-21 01:58:54 -08:00
Ignacio Olaciregui 2c3f807ace Fix no shadow warnings (#22190)
Summary:
Fixes `no-shadow` eslint errors.
Pull Request resolved: https://github.com/facebook/react-native/pull/22190

Differential Revision: D13564238

Pulled By: cpojer

fbshipit-source-id: 96ba36b397088fa406e8f5781b1538a0b6804a8d
2019-01-01 17:13:15 -08:00
glevi@fb.com 24f8d4d3db Deploy v0.89
Reviewed By: jbrown215

Differential Revision: D13457087

fbshipit-source-id: 9f01371ae3515990c5595f1eb2361174050066b8
2018-12-14 13:57:50 -08:00
Fred Liu 1a499f43b2 Enable removeClippedSubviews on Android only for improved scrolling performance
Summary: Android scrolling performance is very poor with this disabled. iOS has some KP with this enabled, so disable it for iOS.

Reviewed By: sahrens

Differential Revision: D13363494

fbshipit-source-id: efab77b5db9676dd0521ae4193465d45ac34dda3
2018-12-12 12:55:02 -08:00
Luis Flores f14edd8a0c Fix ListViewMock unique key error (#14894)
Summary:
Add key prop to renderHeader and renderFooter in ListViewMock.
Fix unique key error when using jest snapshots.

It closes #12762
Pull Request resolved: https://github.com/facebook/react-native/pull/14894

Reviewed By: TheSavior

Differential Revision: D13396721

Pulled By: cpojer

fbshipit-source-id: 5bbcb8157e3cd98fe07f2a037e1dbc06ab599c87
2018-12-10 17:13:54 -08:00
hyochan 198eb02697 Fix ListEmptyComponent is rendered upside down when using inverted flag. (#21496)
Summary:
Fix ListEmptyComponent is rendered upside down when using inverted flag.

Fixes #21196
Pull Request resolved: https://github.com/facebook/react-native/pull/21496

Differential Revision: D13334437

Pulled By: hramos

fbshipit-source-id: b34a9a0a153862d3d5dbe410ab0a6c66a8cfcffd
2018-12-04 18:49:00 -08:00
Christoph Nakazawa 4148976a83 Use `invariant` instead of `fbjs/lib/invariant`
Summary: This is one more step to remove `fbjs` from `react-native-github`. This changes both the internal and external code to use `invariant` from zertosh instead of the copy in fbjs.

Reviewed By: yungsters

Differential Revision: D13195941

fbshipit-source-id: 73564ca1715110e7da9c7ef56dc57374d61377e0
2018-12-03 00:07:02 -08:00
Krzysztof Sroka d3f3bfa2a5 Added `persistentScrollbar` prop in ScrollView component (#22300)
Summary:
This PR is a follow-up from the closed [discussions-and-proposals PR](https://github.com/react-native-community/discussions-and-proposals/pull/39), that explains in more detail the rationale for adding this feature.
Pull Request resolved: https://github.com/facebook/react-native/pull/22300

Reviewed By: fkgozali

Differential Revision: D13121748

Pulled By: mdvacca

fbshipit-source-id: 899641be79bdb41fa6649df0772c602a5e09b3b9
2018-11-27 11:21:54 -08:00
Ignacio Olaciregui 41eb2da33b Fix inline styles warning in Libraries (#22161)
Summary:
Fixes `react-native/no-inline-styles` eslint warnings in the `Libraries` module.
Pull Request resolved: https://github.com/facebook/react-native/pull/22161

Differential Revision: D12946899

Pulled By: TheSavior

fbshipit-source-id: c97ffa50dd90529dabf30a3d2cb09476acc568cb
2018-11-06 14:32:43 -08:00
Fernando Ruiz efc9506a8e Modified declarations from vars to const (#22070)
Summary:
Replaces the keywords `var` with `const` in `Libraries/Lists/ListView/ListViewDataSource.js`
Pull Request resolved: https://github.com/facebook/react-native/pull/22070

Differential Revision: D12895068

Pulled By: TheSavior

fbshipit-source-id: f191158396a0f03bb78942a57b08ec96348a9b32
2018-11-01 17:13:17 -07:00
Ignacio Olaciregui ae8ec39397 Fix linting issues (#22062)
Summary:
Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes.

I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input.
Pull Request resolved: https://github.com/facebook/react-native/pull/22062

Differential Revision: D12889447

Pulled By: TheSavior

fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50
2018-11-01 14:29:16 -07:00
Wen-Chien Chen 5803772017 Wrap measureLayoutRelativeToContainingList in try-catch to mitigate crash
Summary: This function sometimes causes an "Unable to find node on an unmounted component" crash during pagination for reasons that still need to be investigated; in the meanwhile, wrap this in a try-catch block to mitigate the crash.

Reviewed By: sahrens

Differential Revision: D12829971

fbshipit-source-id: bc9fe5b9b8c03430ff890bfbb27c39aa270c9eb7
2018-10-30 17:05:00 -07:00
Eli White af4903ed73 Cleanup legacyImplementation code from FlatList
Summary:
This functionality was removed here: 636d01bbd0

This is just a step of cleanup

Reviewed By: yungsters

Differential Revision: D10515512

fbshipit-source-id: 6d24cc9c53c71924a82c67a4058585ee978de2d9
2018-10-24 14:22:54 -07:00
Thomas BARRAS 70b5eb3aa2 ListView requestAnimationFrame leak (#21802)
Summary:
Related to https://github.com/facebook/react-native/pull/21488
Disclaimer: I made this PR.

I think there's some requestAnimationFrame events that are not cleared on unmount because of bad use of `splice` method.

- All flow tests succeed.
- RNTester: iOS (this change should only affect iOS because calculateChildFrames is iOS only)
Show perf monitor, show ListView* screen, start scrolling. UI frame Rate is used at the beginning. When scrolling there is no drop in FPS rate.
- TODO: I'll write a load test for ListView

[GENERAL] [ENHANCEMENT] [ListView.js] - rm TimerMixin
Pull Request resolved: https://github.com/facebook/react-native/pull/21802

Differential Revision: D10391812

Pulled By: RSNara

fbshipit-source-id: 49f0b0a4641ec29bcb4cc04bd3bafb42b3842b69
2018-10-15 18:09:16 -07:00
Marshall Roch 7b150690b6 @allow-large-files [flow] update to v0.83
Reviewed By: fishythefish

Differential Revision: D10362346

fbshipit-source-id: 0f4cc9977cfaa947e3b23112dd1cf482642e2319
2018-10-13 01:32:48 -07:00
Eli White 4a5221884f Remove MetroListView from SectionList
Reviewed By: yungsters

Differential Revision: D10251054

fbshipit-source-id: dc801817dfcf2722e4625178117006ab51e57255
2018-10-09 17:31:27 -07:00
Eli White 636d01bbd0 Remove legacyImplementation from FlatList and SectionList
Summary:
`legacyImplementation` has caused a warning in FlatList for a long time. FlatList supports the use cases of the legacy implementation and should be adopted.

We will be removing the deprecated MetroListView and ListView components to reduce bundle sizes and the complexity of the codebase.

Reviewed By: yungsters

Differential Revision: D10245824

fbshipit-source-id: 60ff0d54974649b57bac9f9f29b769f34ca2701c
2018-10-09 17:31:27 -07:00
Thomas BARRAS 8ceb1586ee Remove TimerMixin from ListView (#21488)
Summary:
Related to #21485

- Remove TimerMixin from ListView

- All flow tests succeed.
- RNTester: <ListView> iOS (this change should only affect iOS because calculateChildFrames is iOS only)
Show perf monitor, show ListView* screen, start scrolling. UI frame Rate is used at the beginning. When scrolling there is no drop in FPS rate.

TODO: I think a load test would be more relevant:
- Update props multiple times and scroll

[GENERAL] [ENHANCEMENT] [ListView.js] - rm TimerMixin
Pull Request resolved: https://github.com/facebook/react-native/pull/21488

Differential Revision: D10219088

Pulled By: RSNara

fbshipit-source-id: 946e4fc1319324c5bf4947a2060b18bebb6fc493
2018-10-05 12:20:24 -07:00
Eli White 3aa8f09b44 Deprecate legacyImplementation
Summary: The legacy implementation doesn't provide additional functionality and has a negative impact on performance and user experience. The legacyImplementation prop is deprecated and will be removed in a future release.

Reviewed By: yungsters

Differential Revision: D10212762

fbshipit-source-id: 9b3416434ba392827b538c984c7ab4bcbe156e60
2018-10-05 10:23:21 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Logan Daniels 122dc37afe Deeply compare viewabilityConfigs to avoid triggering invariant unnecessarily
Summary:
Currently, modifying a component that renders a FlatLists while Hot Reloading is enabled will trigger an invariant inside FlatList for changing viewabilityConfig on the fly. This happens because it checks object equality between the configs.

By checking equality of the config's *properties* instead, we maintain the efficacy of the invariant but keep it from falsely triggering during development.

Reviewed By: sahrens

Differential Revision: D9466129

fbshipit-source-id: 67149e9e70ad7b2e2584bb7ec03e2dea26ef45e8
2018-08-24 14:32:07 -07:00
Eli White 76948ad1bd Typing View style as ViewStyleProp
Summary: Locking down view style so that invalid styles can't be passed into View.

Reviewed By: yungsters

Differential Revision: D9309097

fbshipit-source-id: 69e7e3c5626609cfd47c167027a55470c42228c8
2018-08-14 16:32:11 -07:00
Wayne Cheng f536a0c268 Adding flow strict local to remaining possible files in xplat/JS
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
  until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9004573

fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
2018-08-09 08:54:44 -07:00
Rasmus K. Brosbøl e0c73633cf VirtualizedList: Fix spacer size calculation (#18105)
Summary:
See https://github.com/facebook/react-native/issues/18104

Tested the above snack with:
- stickyHeadersEnabled true/false
- initialScrollIndex set and not

Visibly verified consistent rendering.

[GENERAL] [BUGFIX] [VirtualizedList] - Fix for jumpy content when initialScrollIndex specified
Pull Request resolved: https://github.com/facebook/react-native/pull/18105

Differential Revision: D8382122

Pulled By: sahrens

fbshipit-source-id: 9421351469e8684bc61438605abbd9988b664c29
2018-07-20 00:17:05 -07:00
Michael Ficaro a2675ced4e Adding new styling props to FlatList/VirtualizedList for ListHeaderComponent and ListFooterComponent
Summary:
We ran into a problem trying to style the optional prop `ListHeaderComponent` in the `FlatList` library component. Essentially we wanted to make `ListHeaderComponent` a flex item that filled all of the empty space in the list if there was any. Unfortunately the `ListHeaderComponent` is later wrapped in a `View` that blocked our styling. The `View` component was necessary as it added styling to handle inverting the `FlatList`. Similarly `ListFooterComponent` was handled the same way.

We came up the simple solution of adding two new optional props, `ListHeaderComponentStyle` and `ListFooterComponentStyle`, that are of type `ViewStyleProp` that allow users to pass in styling for `ListHeaderComponent` and `ListFooterComponent`.

With this change we were able to do something like the following to get the header component to fill all empty space in the `FlatList`.

```
<FlatList
    ...
    contentContainerStyle={{flexGrow: 1}}
    ListHeaderComponent={<View style={{flex: 1}} />}
    ListHeaderComponentStyle={{flexGrow: 1}}
    ...
/>
```
This solution will give users a lot more freedom when working with headers and footers.

Reviewed By: sahrens

Differential Revision: D8777038

fbshipit-source-id: f34116ce68548ea70223e639d0f84a099327f6b3
2018-07-12 13:49:08 -07:00
Konstantin Raev 604bcfa4a8 Revert D8683555: [react-native][PR] fix: account for `ListHeaderComponent` length when calculating offset…
Differential Revision:
D8683555

Original commit changeset: 05df7b79c16e

fbshipit-source-id: 6deb14b99fe04e67e264455ff92a5d8c1c2dd406
2018-07-06 19:32:21 -07:00
Spencer Ahrens 5b6ff01764 Remove ScrollView.propTypes
Summary:
We're unifying on flow types, and propTypes require non-trivial resources to initialize in aggregate.

Some open source code might depend on extracting ScrollView.propTypes which will now fail. To fix, simplly remove these dependencies and use flow or typescript for verifying correct prop usage instead.

Reviewed By: TheSavior

Differential Revision: D8726371

fbshipit-source-id: 19e9540794db97a9e356615b544759a0753fd68c
2018-07-05 15:18:04 -07:00
Shane Osbourne dbc23466b3 fix: account for `ListHeaderComponent` length when calculating offset… (#17415)
Summary:
… in VirtualizedList - fixes #16612

Issue is detailed in #16612

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I need `onViewableItemsChanged` to account for the length of any ListHeaderComponents

I couldn't find any tests that currently cover the use-case of a VirtualizedList + ListComponent + scroll with onViewableItemsChanged, so I have not added any tests - all previous tests pass however.

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

[GENERAL][BUGFIX][VirtualizedList] - account for `ListHeaderComponent` length
Closes https://github.com/facebook/react-native/pull/17415

Differential Revision: D8683555

Pulled By: hramos

fbshipit-source-id: 05df7b79c16e3c07c12468e782f3c4b0bdce7403
2018-06-28 15:32:39 -07:00
Peter van der Zee 29fb2a8e90 Bump Prettier to 1.13.4 on xplat
Summary:
Bump Prettier to use version 1.13.4
All code changes are caused by running Prettier and should only affect files that have an `format` header.
All other changes caused by yarn.

Reviewed By: ryanmce

Differential Revision: D8251255

fbshipit-source-id: 0b4445c35f1269d72730f2000002a27c1bc35914
2018-06-06 05:32:06 -07:00
Logan Daniels 4435f08771 Trigger nested VirtualizedLists to re-measure if their containing cell's onLayout fires
Reviewed By: sahrens

Differential Revision: D8272040

fbshipit-source-id: c490ffa875bfd0547ac54d214c5ebbeb23c99942
2018-06-04 21:18:01 -07:00
Héctor Ramos 95554add98 Update Jest snapshots
Summary:
Jest will now exclude undefined props from snapshots (https://github.com/facebook/jest/pull/6162). Updating the snapshots should fix the current `test_javascript` failures.

Circle CI

[INTERNAL][MINOR][Snapshots] - Update snapshots
Closes https://github.com/facebook/react-native/pull/19414

Differential Revision: D8125193

Pulled By: hramos

fbshipit-source-id: db8dcfcd8afbf9d6256f83c6e922680a7872d776
2018-05-29 17:30:16 -07:00
Spencer Ahrens a90d0e3614 fixup FlatList
Summary:
StrictMode compliance is important for Async Rendering and other Future Tech(tm).

Also clean up some lint.

== Test Plan ==
* No more StrictMode warnings for `FlatList` (`VirtualizedList` is another story....).
* props warnings still show up when appropriate.

Reviewed By: sophiebits

Differential Revision: D8026333

fbshipit-source-id: e6fa2f02d546b883df6f3cff8776c26c6ef91bc9
2018-05-25 15:10:41 -07:00
Spencer Ahrens 26a1eba1ce VirtualizedSectionList
Reviewed By: yungsters

Differential Revision: D8021463

fbshipit-source-id: 8b65585776cf41e194418d127bca85dbe47ea659
2018-05-25 15:10:41 -07:00
Spencer Ahrens 488a4c7e1c Fix VirtualizedSectionList:ItemWithSeparators
Reviewed By: yungsters

Differential Revision: D8021407

fbshipit-source-id: 480547d867eda476fe6ddf4af74072ad1851a427
2018-05-25 15:10:41 -07:00
Spencer Ahrens 7d741d1119 Prettier
Reviewed By: bestander

Differential Revision: D8067792

fbshipit-source-id: 6ea8f46c3dce80afc3689ba55f348aa645af391e
2018-05-19 09:44:29 -07:00
Eli White 4b1ecb6204 Flowtype ListView
Reviewed By: yungsters

Differential Revision: D7985836

fbshipit-source-id: 6e0944a8d2fb85aabc34dfd3125a07b208749f21
2018-05-14 00:24:44 -07:00
Eli White af6e2eb02d Removing unnecessary FlowFixMe
Reviewed By: yungsters

Differential Revision: D7985749

fbshipit-source-id: ba7e152749c5a5cac134b51e0229dc11870bb3e0
2018-05-14 00:24:44 -07:00
Tim Yung 752863629d RN: Fix Type for ReactNative.NativeComponent (2/2)
Reviewed By: TheSavior

Differential Revision: D7984936

fbshipit-source-id: d0477c54420b49220e9529fa70c2b2babce0b409
2018-05-13 01:05:57 -07:00
Eli White 91c4b0357a Remove unused suppressions
Reviewed By: yungsters

Differential Revision: D7982027

fbshipit-source-id: 00e538dc678275495e097d9cd14a0a2643ebaefd
2018-05-12 10:35:27 -07:00
Eli White f19ee28e7d Adding $FlowFixMe to invalid prop accesses
Reviewed By: yungsters

Differential Revision: D7977387

fbshipit-source-id: 442e7445be62f78bdf166a2b97ef031e39877355
2018-05-12 10:35:27 -07:00
Eli White 7ba7acdee7 Surfacing Flow issues around invalid props
Reviewed By: yungsters

Differential Revision: D7977386

fbshipit-source-id: a6df2d75e0caa55a84f9c9c6860f622942955dfc
2018-05-12 10:35:27 -07:00
Eli White d01ab66b47 Prettier React Native Libraries
Reviewed By: sahrens

Differential Revision: D7961488

fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
2018-05-10 19:10:38 -07:00
Eli White 8f5ebe5952 Convert react-native-github/Libraries to let/const
Reviewed By: sahrens

Differential Revision: D7956042

fbshipit-source-id: 221851aa311f3cdd6326497352b366048db0a1bb
2018-05-10 16:16:35 -07:00
Payton Yao c18cf5bd4a Prevent unintended VirtualizedList high priority rendering
Summary:
VirtualizedList sets high priority rendering when scrolled to the top of a list even if the bottom of the rendered list is still far away and there's nothing further to render above. This causes severe non-responsiveness while dozens of items are waiting to be rendered and user inputs can't get through.

The fix is simply to not consider it high priority to render more items when we reach the top and the first item has already been rendered, or when we reach the bottom and the last item has been rendered.

The code change just splits the two cases (hitting the top and bottom) instead of combining them into one.

I wrote a small application that switches between two FlatLists.

Demo of the original VirtualizedList
<img src="https://user-images.githubusercontent.com/3090032/39456709-2c87069e-4d1b-11e8-8535-5bda6d59400c.gif" width="270" height="480">

I'm clicking pretty often on the button, but you can see that it only switches lists a split second after the rendering is all done because the javascript thread was being blocked.

Demo of the fixed VirtualizedList
<img src="https://user-images.githubusercontent.com/3090032/39456844-00312448-4d1c-11e8-805f-cbe17aa3f95e.gif" width="270" height="480">
You can see this one is significantly more responsive than the previous one.

The source code for the demo application is available [here](https://gist.github.com/jabbawookiees/ba93a4e7b4f9b8f3acbc157e4fd04877)

[ GENERAL ] [ ENHANCEMENT ] [ Libraries/Lists/VirtualizedList.js  ] - Prevent high priority rendering at the top or bottom of a list.
Closes https://github.com/facebook/react-native/pull/19081

Differential Revision: D7933994

Pulled By: sahrens

fbshipit-source-id: 13c9f73baeb3487620b720854a753287ac0aa1fa
2018-05-09 11:03:22 -07:00
Rubén Norte d5e9e55fa3 Remove @providesModule from all modules
Summary:
This PR removes the need for having the `providesModule` tags in all the modules in the repository.

It configures Flow, Jest and Metro to get the module names from the filenames (`Libraries/Animated/src/nodes/AnimatedInterpolation.js` => `AnimatedInterpolation`)

* Checked the Flow configuration by running flow on the project root (no errors):

```
yarn flow
```

* Checked the Jest configuration by running the tests with a clean cache:

```
yarn jest --clearCache && yarn test
```

* Checked the Metro configuration by starting the server with a clean cache and requesting some bundles:

```
yarn run start --reset-cache
curl 'localhost:8081/IntegrationTests/AccessibilityManagerTest.bundle?platform=android'
curl 'localhost:8081/Libraries/Alert/Alert.bundle?platform=ios'
```

[INTERNAL] [FEATURE] [All] - Removed providesModule from all modules and configured tools.
Closes https://github.com/facebook/react-native/pull/18995

Reviewed By: mjesun

Differential Revision: D7729509

Pulled By: rubennorte

fbshipit-source-id: 892f760a05ce1fddb088ff0cd2e97e521fb8e825
2018-04-25 07:37:10 -07:00
Alex McKelvey 4a802100d1 Improve VirtualizedList yellow-box warning when item is missing a key
Reviewed By: sahrens

Differential Revision: D7746659

fbshipit-source-id: b271dcd604d9adb85d0996dce5b8af1a6efd37d2
2018-04-24 13:47:46 -07:00
Peter van der Zee 3c0b8922e2 Upgrade Prettier to v1.12.1 on fbsource
Reviewed By: benjaffe, ryanmce, yungsters

Differential Revision: D7652946

fbshipit-source-id: 396d45c675e93f2298cd2920d927630c81867447
2018-04-19 02:45:35 -07:00
Avik Chaudhuri d2a1461d26 @allow-large-files clean up xplat/js for flow 0.70.0
Reviewed By: fishythefish

Differential Revision: D7643236

fbshipit-source-id: 1d9a95f1e249ce3fdc552a4ca92a6c63b267dae4
2018-04-17 05:42:01 -07:00
Peter Argany fd4bc72512 Add custom RefreshControl support to VirtualizedList
Reviewed By: TheSavior, mmmulani

Differential Revision: D7388137

fbshipit-source-id: 8a1448e5fc526b45773fe4a4f123a179d4a8bee9
2018-03-27 18:19:30 -07:00
Danny Cochran dd479a9377 Pass invertStickyHeaders to ScrollView
Summary:
invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in https://github.com/facebook/react-native/issues/18471

Fixes #18471

Pass "invertStickyHeaders: false" to a SectionList (or FlatList), and expect that your sticky headers stick to the bottom of the ScrollView, instead of the top.

none

[ANDROID] [BUGFIX] [SectionList] - invertStickyHeaders can now be set from SectionList or FlatList.
Closes https://github.com/facebook/react-native/pull/18524

Differential Revision: D7386163

Pulled By: hramos

fbshipit-source-id: 3b66dfca280e657303f69f98c5a8bc0df033f9f7
2018-03-23 15:12:39 -07:00
Sam Goldman 0d924dd629 Upgrade to Flow v0.68.0
Reviewed By: gabelevi

Differential Revision: D7310349

fbshipit-source-id: 70d29815dd7912704aec8a015c970be3fafeeba3
2018-03-19 18:31:36 -07:00
Janic Duplessis db061ea8c7 Don't wrap ListEmptyComponent in an extra view
Summary:
A common UI pattern for list empty states is some text/images centered inside the visible part of the list. This is pretty hard to do currently because we wrap ListEmptyComponent with an extra view with no way to style it so we cannot just use `flex: 1` to make it fill the available space.

- Added an example of ListEmptyComponent in the FlatList example in RNTester

Before (no way to make ListEmptyComponent fill the space):
<img width="377" alt="screen shot 2018-03-05 at 5 24 15 pm" src="https://user-images.githubusercontent.com/2677334/37003152-129db3ac-209a-11e8-9600-110f10d57144.png">

After:
<img width="377" alt="screen shot 2018-03-05 at 5 09 20 pm" src="https://user-images.githubusercontent.com/2677334/37002809-e6971178-2098-11e8-8cf7-74bfb2f6a992.png">

- Tested some edge cases like returning null from the ListEmptyComponent

- Tested in an app that uses FlatList + ListEmptyComponent

[GENERAL] [MINOR] [VirtualizedList] - Don't wrap ListEmptyComponent in an extra view
Closes https://github.com/facebook/react-native/pull/18206

Differential Revision: D7266274

Pulled By: sahrens

fbshipit-source-id: 4636d2418474a4c86ac63e5e18a9afc391a518c5
2018-03-13 18:11:31 -07:00
Eli White 5035af80ec Tightening types for View and VirtualizedList
Reviewed By: yungsters

Differential Revision: D7215391

fbshipit-source-id: fa144c0dc3fd897864403b589e943ea88e78a999
2018-03-09 15:11:46 -08:00
Eli White b6b80f6a70 Type VirtualizedList's ref
Reviewed By: yungsters

Differential Revision: D7215114

fbshipit-source-id: 867a7b897f27d415269c11572708afeb570b4be0
2018-03-09 12:42:06 -08:00
Eli White 25b8ec81df Adding FlowFixMe when switching between Component and Ref
Reviewed By: yungsters

Differential Revision: D7215800

fbshipit-source-id: 175f769a2b1fc67e72b10e113a96eb4167437ab0
2018-03-09 12:12:21 -08:00
Eli White a3c07c95ef StyleObj -> DangerouslyImpreciseStyleProp
Summary:
Migrating everything to import from StyleSheet instead of StyleSheetTypes.

Search and replaced
```
import type {StyleObj} from 'StyleSheetTypes';
```
to
```
import type {DangerouslyImpreciseStyleProp} from 'StyleSheet';
```

and then replacing `StyleObj` with `DangerouslyImpreciseStyleProp` and fixing up the remaining flow errors by hand.

Reviewed By: yungsters

Differential Revision: D7184077

fbshipit-source-id: b8dabb9d48038b5a997ab715687300bad57aa9d4
2018-03-07 13:24:20 -08:00
Sophie Alpert 19b9851999 Update VirtualizedList to not throw with double constructor
Summary: constructor shouldn't have side effects.

Reviewed By: sahrens

Differential Revision: D7146018

fbshipit-source-id: 0ca311e48d6bad81988ed48605c8134068c482da
2018-03-05 14:17:07 -08:00
Caleb Meredith da3424c929 @allow-large-files Upgrade xplat/js to Flow v0.66
Reviewed By: gabelevi

Differential Revision: D7016717

fbshipit-source-id: 2bd2fd67074ba5d405ecd63a1aeb37354f8634c9
2018-02-16 20:24:57 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
Brian Vaughn 6f007e8957 Ran rename-unsafe-lifecycles codemod on xplat/js
Reviewed By: trueadm

Differential Revision: D6889214

fbshipit-source-id: e815cda4b09f3650ae3b0b9a44ae6f5fcb48fe25
2018-02-08 10:58:31 -08:00
Oleg Lokhvitsky ef596dec49 Fix initialScrollIndex for Android
Reviewed By: sahrens

Differential Revision: D6885608

fbshipit-source-id: c153fcb5c2552982481d8af8b9755ae035e9b293
2018-02-02 16:02:12 -08:00
Logan Daniels ae2d5b1e68 Nested virtualized lists should receive recordInteration events
Summary:
Right now when an interaction is recorded on a parent VirtualizedList, the interaction isn't passed on to its children. That means that if `waitForInteraction` is set to true for a child list's viewability helper, it will never trigger a VPV.

This change adds forwarding of these events inside `onBeginScrollDrag`. It also forwards the interaction state of the parent list at register time, in case a child list is rendered mid-scroll.

Reviewed By: sahrens

Differential Revision: D6822091

fbshipit-source-id: dfe300e42722d4285f65787ab2c1368f050c5577
2018-01-29 12:13:58 -08:00
Janic Duplessis ecaca80d42 Support sticky headers for inverted Lists
Summary:
Sticky headers for inverted lists should still stick at the top of the list instead of the bottom.

Tested by adding the inverted prop to the SectionList example in RNTester.

It does add a prop to ScrollView but it's very specific to the inverted list implementation, not sure if it should be documented.

[GENERAL][ENHANCEMENT][LISTS] -  Support sticky headers for inverted Lists
Closes https://github.com/facebook/react-native/pull/17762

Differential Revision: D6830784

Pulled By: sahrens

fbshipit-source-id: 6841fdd46e04b30547659d85ff54c3a21c61a8a2
2018-01-29 11:46:26 -08:00
Semen Zhydenko d2c569795c Typos in comments and log messages
Summary:
No code changes, no testing required.

alligned -> aligned
allignment -> alignment
completly -> completely
conseptually -> conceptually
decendents -> descendants
indefinetly -> indefinitely
dimention -> dimension
doesnt -> doesn't
safegaurd -> safeguard
intialization -> initialization
hierachy -> hierarchy
happend -> happened
gaurd -> guard
programatically -> programmatically
initalized -> initialized
immidiately -> immediately
occured -> occurred
unkown -> unknown
neccessary -> necessary
neccesarily -> necessarily
occuring -> occurring
comoponent -> component
propogate -> propagate
recieved -> received
referece -> reference
perfomance -> performance
recieving -> receiving
subsquently -> subsequently
scoll -> scroll
suprisingly -> surprisingly
targetting -> targeting
tranform -> transform
symetrical -> symmetrical
wtih -> with
Closes https://github.com/facebook/react-native/pull/17578

Differential Revision: D6718791

Pulled By: shergin

fbshipit-source-id: 4ab79c1131ec5971d35a0c7199eba7ec0a0918ad
2018-01-12 22:18:45 -08:00
Eli White 11a495cb32 Fixing eslint-comments warnings
Reviewed By: yungsters

Differential Revision: D6678252

fbshipit-source-id: ee93b7ee52520b750ca11fcc625cccf3cd82d075
2018-01-08 17:04:29 -08:00
glevi@fb.com 6b95c4fb14 @allow-large-files [Flow] Upgrade xplat/js to flow v0.63
Reviewed By: samwgoldman

Differential Revision: D6675320

fbshipit-source-id: 85575a6f30a50a3c40c6b46ba36f8cd33c091b1d
2018-01-08 12:49:53 -08:00
Matt Sessions a8391bde7d SectionList renderItem should be optional
Summary:
`renderItem` on `SectionList` is within the `OptionalProps` group of props but it is not actually marked as optional. Which means that doing things such as in the example where each section has its own `renderItem` and no `renderItem` prop is passed into `SectionList` will fail flow.

Create a `SectionList` where each section has it's own `renderItem` and do not pass in a `renderItem` into `SectionList`. Run flow, it should error.

[GENERAL] [MINOR] [SectionList] -Makes `renderItem` prop on `SectionList` optional for flow.
Closes https://github.com/facebook/react-native/pull/17262

Differential Revision: D6645672

Pulled By: hramos

fbshipit-source-id: 1096e8c4998c14003cf42f29ea559505082047c1
2017-12-29 14:26:08 -08:00
Logan Daniels 3559e42c55 Make sure VirtualizedList's windowSize is greater than 0
Summary:
Setting `windowSize = 0` doesn't make sense. Let's make sure we catch this problem in the constructor so that it doesn't cause inexplicable list behavior.

Also fixed an invariant in `VirtualizeUtils` that is meant to prohibit non-monotonically-increasing offset arrays. As written, the invariant condition can never actually be violated.

Reviewed By: sahrens

Differential Revision: D6625302

fbshipit-source-id: b2a983cbe7bb5fbe0aed7c5d59e69a8a00672993
2017-12-21 18:43:50 -08:00
Logan Daniels a010a0cebd Fix virtualized cell keys for list headers and footers
Summary:
The change enabling virtualization in nested lists contained a hidden assumption that nested lists would only appear within the *cells* of a parent list.

If a list header or footer component contains a `VirtualizedList`, that child list won't be wrapped in a `CellRenderer` component and therefore won't have access to `virtualizedCellRenderer` through its context. This causes an error when the child list tries to access the `cellKey` property on an undefined object.

This change wraps the header/footer views in a `VirtualizedCellWrapper` component which supplies that context properly.

Reviewed By: sahrens

Differential Revision: D6603342

fbshipit-source-id: 4d2d82f04947048a16ec9968121d8ecc8c95655a
2017-12-19 13:46:49 -08:00
Logan Daniels 2668dc8e1b Support virtualization and onViewableItemsChanged for nested, same-orientation VirtualizedLists
Reviewed By: sahrens

Differential Revision: D6330846

fbshipit-source-id: c555f4d449b75753befbd376dbf4e6fb4812fa75
2017-12-18 13:32:35 -08:00
Adam Ernst 9f33fe2583 Upgrade to 1.9.1
Reviewed By: vjeux

Differential Revision: D6497877

fbshipit-source-id: 3b88b96e375ddf1fbe039a0593569bbdde40a2dc
2017-12-06 17:34:26 -08:00
Spencer Ahrens c6fe101cdc export SeparatorsObj type for re-use in ListItems etc.
Differential Revision: D6354300

fbshipit-source-id: 3fd4c86ef1d190fb544f2c6fccb638ffe3ced378
2017-11-29 10:53:51 -08:00
Chris Lewis 22a1419900 Fix $FlowFixMe in Flatlist
Summary:
$FlowFixMe suppressed type validation on _listRef. Add appropriate typing to let Flow succeed when $FlowFixMe is removed.

Not sure what this project's philosophy around ref types is. In some places I've seen them annotated as any rather than trying to get a more granular type to match. I'm open to suggestions.

`yarn flow`

[INTERNAL] [ENHANCEMENT] [FlatList.js] - Remove $FlowFixMe from FlatList
Closes https://github.com/facebook/react-native/pull/16882

Differential Revision: D6386479

Pulled By: hramos

fbshipit-source-id: bed14f2c7071525cb46425ab14214771de0277f3
2017-11-29 09:15:50 -08:00
Logan Daniels d19d137cc1 Fix minimumViewTime in ViewabilityHelper
Reviewed By: sahrens

Differential Revision: D6350352

fbshipit-source-id: e909600875156127eb3144726981ab62e0015e6e
2017-11-16 20:15:46 -08:00
Caleb Meredith eb0d6470e5 Flow 0.59 xplat/js deploy
Reviewed By: avikchaudhuri

Differential Revision: D6300238

fbshipit-source-id: a6839fa2a9bbc50c3832a3f5b1cac2a6d2bd96b7
2017-11-10 21:15:48 -08:00
Miguel Jimenez Esun 16bbd908e7 Update Jest to 21.3.0-beta.8
Reviewed By: davidaurelio

Differential Revision: D6221784

fbshipit-source-id: 189e895378635dd21d14d6fb1f93510a52c90742
2017-11-08 07:03:30 -08:00
Avik Chaudhuri a48da14800 @allow-large-files Flow 0.58 upgrade for xplat/js
Reviewed By: yungsters

Differential Revision: D6219339

fbshipit-source-id: f003111500ef5971b9a95f26d43cee6644c16abe
2017-11-02 10:51:14 -07:00
Miguel Jimenez Esun 834b9d4e6e Adding @email tags to most of the tests
Reviewed By: rafeca

Differential Revision: D6185623

fbshipit-source-id: 30df83288fe85516d8d5a1617a4fb8fea826ed6f
2017-11-02 06:25:03 -07:00
youngjl1 95bf367981 Spelling fix
Summary:
occured > occurred

Improve code comments by fixing a typo.

No code was changed!

Closes https://github.com/facebook/react-native/pull/16558

Differential Revision: D6188381

Pulled By: shergin

fbshipit-source-id: 719a8d3bc9b42877b9b8218de32fc87b8ca8dd7f
2017-10-30 12:36:16 -07:00
Martin Rädlinger 6747a36f5d VirtualizedList: fix bug where onViewableItemsChanged wouldn't trigger
Summary:
In the current implementation of the `VirtualizedList` the `onViewableItemsChanged` callback wouldn't trigger if the underlying list data changes. (see example snack https://snack.expo.io/Hk5703eBb)

I added a method in the `ViewabilityHelper` to invalidate the cached viewableIndices, which gets triggered when the list-data changes.
Closes https://github.com/facebook/react-native/pull/14922

Differential Revision: D5864537

Pulled By: sahrens

fbshipit-source-id: 37f617763596244208548817d5b138dadc12c75d
2017-10-16 04:35:05 -07:00