Skip to content

Commit 8d60e45

Browse files
committed
Add a tag option for the wrapper element
1 parent 909b168 commit 8d60e45

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/index.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ const store ={
88
};
99

1010
export default class extends React.Component {
11+
static propTypes = {
12+
onChange: React.PropTypes.func,
13+
tag: React.PropTypes.string
14+
};
15+
static defaultProps = {
16+
tag: 'div'
17+
};
18+
1119
sortable = null;
1220

1321
componentDidMount() {
@@ -57,8 +65,7 @@ export default class extends React.Component {
5765
this.sortable = Sortable.create(ReactDOM.findDOMNode(this), options);
5866
}
5967
render() {
60-
return (
61-
<div className={this.props.className}>{this.props.children}</div>
62-
);
68+
const { children, className, tag } = this.props;
69+
return React.DOM[tag]({ className }, children);
6370
}
6471
}

0 commit comments

Comments
 (0)