Skip to content

Commit b38d1d4

Browse files
author
Marek Rozmus
committed
Add threshold prop to list
1 parent bfbf26a commit b38d1d4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/SwipeableList.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33

44
import styles from './SwipeableList.css';
55

6-
const SwipeableList = ({ children }) => {
6+
const SwipeableList = ({ children, threshold }) => {
77
const [blockSwipe, setBlockSwipe] = useState(false);
88

99
useEffect(() => {
@@ -31,14 +31,15 @@ const SwipeableList = ({ children }) => {
3131
data-testid="list-wrapper"
3232
>
3333
{React.Children.map(children, child =>
34-
React.cloneElement(child, { blockSwipe })
34+
React.cloneElement(child, { blockSwipe, threshold })
3535
)}
3636
</div>
3737
);
3838
};
3939

4040
SwipeableList.propTypes = {
41-
children: PropTypes.node
41+
children: PropTypes.node,
42+
threshold: PropTypes.number
4243
};
4344

4445
export default SwipeableList;

0 commit comments

Comments
 (0)