Skip to content

Commit b675024

Browse files
committed
make it possible to use react component or string
1 parent c9d1ab3 commit b675024

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ const SortableList = ({ items, onChange }) => {
8686
}
8787
}}
8888

89-
// [Optional] A tag to specify the wrapping element. Defaults to "div".
89+
// [Optional] A tag or react component to specify the wrapping element. Defaults to "div".
90+
// In a case of a react component it is required to has children in the component
91+
// and pass it down.
9092
tag="ul"
9193

9294
// [Optional] The onChange method allows you to implement a controlled component and keep

src/Sortable.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class Sortable extends Component {
1313
static propTypes = {
1414
options: PropTypes.object,
1515
onChange: PropTypes.func,
16-
tag: PropTypes.string,
16+
tag: PropTypes.oneOfType([
17+
PropTypes.string,
18+
PropTypes.func
19+
]),
1720
style: PropTypes.object
1821
};
1922
static defaultProps = {

0 commit comments

Comments
 (0)