From fb9d4e5ab0648e57c250ca93b333a32339340c47 Mon Sep 17 00:00:00 2001 From: Mohammed Faragallah Date: Wed, 8 Apr 2020 20:45:01 +0200 Subject: [PATCH] allow passing props to SwipeableList div --- src/SwipeableList.js | 13 ++++++++++--- src/module.d.ts | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/SwipeableList.js b/src/SwipeableList.js index 91e2961..ee52c6d 100644 --- a/src/SwipeableList.js +++ b/src/SwipeableList.js @@ -7,9 +7,15 @@ const SwipeableList = ({ children, scrollStartThreshold, swipeStartThreshold, - threshold + threshold, + className, + ...rest }) => ( -
+
{React.Children.map(children, child => React.cloneElement(child, { scrollStartThreshold, @@ -24,7 +30,8 @@ SwipeableList.propTypes = { children: PropTypes.node, scrollStartThreshold: PropTypes.number, swipeStartThreshold: PropTypes.number, - threshold: PropTypes.number + threshold: PropTypes.number, + className: PropTypes.string }; export default SwipeableList; diff --git a/src/module.d.ts b/src/module.d.ts index 18b57c9..47e4ee2 100644 --- a/src/module.d.ts +++ b/src/module.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -interface ISwipeableListProps { +interface ISwipeableListProps extends React.DetailedHTMLProps, HTMLDivElement> { scrollStartThreshold?: number; swipeStartThreshold?: number; threshold?: number;