Fixup comments to indicate sticky headers are now supported

Reviewed By: achen1

Differential Revision: D4822080

fbshipit-source-id: a0f09eedca40ccc72581b7f6e55a09d9e8f3f61f
This commit is contained in:
Spencer Ahrens 2017-04-03 18:36:29 -07:00 committed by Facebook Github Bot
parent e8f9c442d6
commit 128596b311
3 changed files with 24 additions and 16 deletions

View File

@ -237,15 +237,20 @@ type DefaultProps = typeof defaultProps;
* - Internal state is not preserved when content scrolls out of the render window. Make sure all
* your data is captured in the item data or external stores like Flux, Redux, or Relay.
* - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop that
* is not `===` after updates, otherwise your UI may not update on changes. This includes the
* `data` prop and parent component state.
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop
* (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on
* changes. This includes the `data` prop and parent component state.
* - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously
* offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see
* blank content. This is a tradeoff that can be adjusted to suit the needs of each application,
* and we are working on improving it behind the scenes.
* - By default, the list looks for a `key` prop on each item and uses that for the React key.
* Alternatively, you can provide a custom `keyExtractor` prop.
*
* NOTE: `removeClippedSubviews` might not be necessary and may cause bugs. If you see issues with
* content not rendering, e.g when using `LayoutAnimation`, try setting
* `removeClippedSubviews={false}`, and we may change the default in the future after more
* experimentation in production apps.
*/
class FlatList<ItemT> extends React.PureComponent<DefaultProps, Props<ItemT>, void> {
static defaultProps: DefaultProps = defaultProps;

View File

@ -108,7 +108,8 @@ type OptionalProps<SectionT: SectionBase<any>> = {
*/
refreshing?: ?boolean,
/**
* Rendered at the top of each section. Sticky headers are not yet supported.
* Rendered at the top of each section. These stick to the top of the `ScrollView` by default on
* iOS. See `stickySectionHeadersEnabled`.
*/
renderSectionHeader?: ?(info: {section: SectionT}) => ?React.Element<any>,
/**
@ -146,8 +147,6 @@ type DefaultProps = typeof defaultProps;
* If you don't need section support and want a simpler interface, use
* [`<FlatList>`](/react-native/docs/flatlist.html).
*
* If you need _sticky_ section header support, use `ListView` for now.
*
* Simple Examples:
*
* <SectionList
@ -174,15 +173,20 @@ type DefaultProps = typeof defaultProps;
* - Internal state is not preserved when content scrolls out of the render window. Make sure all
* your data is captured in the item data or external stores like Flux, Redux, or Relay.
* - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop that
* is not `===` after updates, otherwise your UI may not update on changes. This includes the
* `data` prop and parent component state.
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop
* (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on
* changes. This includes the `data` prop and parent component state.
* - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously
* offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see
* blank content. This is a tradeoff that can be adjusted to suit the needs of each application,
* and we are working on improving it behind the scenes.
* - By default, the list looks for a `key` prop on each item and uses that for the React key.
* Alternatively, you can provide a custom `keyExtractor` prop.
*
* NOTE: `removeClippedSubviews` might not be necessary and may cause bugs. If you see issues with
* content not rendering, e.g when using `LayoutAnimation`, try setting
* `removeClippedSubviews={false}`, and we may change the default in the future after more
* experimentation in production apps.
*/
class SectionList<SectionT: SectionBase<any>>
extends React.PureComponent<DefaultProps, Props<SectionT>, void>

View File

@ -147,9 +147,9 @@ type State = {first: number, last: number};
* - Internal state is not preserved when content scrolls out of the render window. Make sure all
* your data is captured in the item data or external stores like Flux, Redux, or Relay.
* - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop that
* is not `===` after updates, otherwise your UI may not update on changes. This includes the
* `data` prop and parent component state.
* equal. Make sure that everything your `renderItem` function depends on is passed as a prop
* (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on
* changes. This includes the `data` prop and parent component state.
* - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously
* offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see
* blank content. This is a tradeoff that can be adjusted to suit the needs of each application,
@ -157,11 +157,10 @@ type State = {first: number, last: number};
* - By default, the list looks for a `key` prop on each item and uses that for the React key.
* Alternatively, you can provide a custom `keyExtractor` prop.
*
* NOTE: `LayoutAnimation` and sticky section headers both have bugs when used with this and are
* therefore not officially supported yet.
*
* NOTE: `removeClippedSubviews` might not be necessary and may cause bugs. If you see issues with
* content not rendering, try disabling it, and we may change the default there.
* content not rendering, e.g when using `LayoutAnimation`, try setting
* `removeClippedSubviews={false}`, and we may change the default in the future after more
* experimentation in production apps.
*/
class VirtualizedList extends React.PureComponent<OptionalProps, Props, State> {
props: Props;