diff --git a/src/index.js b/src/index.js index ac4b2d8..6da1b66 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,8 @@ import cssStyle from './style' export default class HorizontalScroll extends Component { static propTypes = { - className: PropTypes.string + className: PropTypes.string, + disabled: PropTypes.bool } constructor (props) { @@ -175,9 +176,10 @@ export default class HorizontalScroll extends Component { } render () { - const { className, children } = this.props + const { className, children, disabled } = this.props const { trackWidth } = this.state const isArrayChild = Array.isArray(children) + if (disabled) return children return (