diff --git a/package.json b/package.json index 442f93f2..4a12ade5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "recyclerlistview", - "version": "3.0.5", + "version": "3.1.0-beta.2", "description": "The listview that you need and deserve. It was built for performance, uses cell recycling to achieve smooth scrolling.", "main": "dist/reactnative/index.js", "types": "dist/reactnative/index.d.ts", diff --git a/src/core/RecyclerListView.tsx b/src/core/RecyclerListView.tsx index 82c48f29..1448e602 100644 --- a/src/core/RecyclerListView.tsx +++ b/src/core/RecyclerListView.tsx @@ -105,6 +105,7 @@ export interface RecyclerListViewProps { style?: object | number; debugHandlers?: DebugHandlers; renderContentContainer?: (props?: object, children?: React.ReactNode) => React.ReactNode | null; + renderItemContainer?: (props: object, parentProps: object, children?: React.ReactNode) => React.ReactNode; //For all props that need to be proxied to inner/external scrollview. Put them in an object and they'll be spread //and passed down. For better typescript support. scrollViewProps?: object; @@ -628,6 +629,7 @@ export default class RecyclerListView
(this.props.itemAnimator, this._defaultItemAnimator)}
extendedState={this.props.extendedState}
internalSnapshot={this.state.internalSnapshot}
+ renderItemContainer={this.props.renderItemContainer}
onItemLayout={this.props.onItemLayout}/>
);
}
@@ -796,12 +798,15 @@ RecyclerListView.propTypes = {
//animations are JS driven to avoid workflow interference. Also, please note LayoutAnimation is buggy on Android.
itemAnimator: PropTypes.instanceOf(BaseItemAnimator),
- //The Recyclerlistview item cells are enclosed inside this item container. The idea is pass a native UI component which implements a
+ //All of the Recyclerlistview item cells are enclosed inside this item container. The idea is pass a native UI component which implements a
//view shifting algorithm to remove the overlaps between the neighbouring views. This is achieved by shifting them by the appropriate
//amount in the correct direction if the estimated sizes of the item cells are not accurate. If this props is passed, it will be used to
//enclose the list items and otherwise a default react native View will be used for the same.
renderContentContainer: PropTypes.func,
+ //This container is for wrapping individual cells that are being rendered by recyclerlistview unlike contentContainer which wraps all of them.
+ renderItemContainer: PropTypes.func,
+
//Enables you to utilize layout animations better by unmounting removed items. Please note, this might increase unmounts
//on large data changes.
optimizeForInsertDeleteAnimations: PropTypes.bool,
diff --git a/src/core/scrollcomponent/BaseScrollComponent.tsx b/src/core/scrollcomponent/BaseScrollComponent.tsx
index dda00e62..20dc54a8 100644
--- a/src/core/scrollcomponent/BaseScrollComponent.tsx
+++ b/src/core/scrollcomponent/BaseScrollComponent.tsx
@@ -16,6 +16,7 @@ export interface ScrollComponentProps {
onLayout?: any;
renderContentContainer?: (props?: object, children?: React.ReactNode) => React.ReactNode | null;
renderAheadOffset: number;
+ layoutSize?: Dimension;
}
export default abstract class BaseScrollComponent extends React.Component