经过一番挖掘,我已经解决了react-range,因为它是轻量级,简单和有效的。
在其sourcerender()
展示它是如何做的:
render: function() {
var props = _extends({}, this.props, {
defaultValue: this.props.value,
onClick: this.onRangeClick,
onKeyDown: this.onRangeKeyDown,
onMouseMove: this.onRangeChange,
onChange: function() {},
ref: this.setRangeRef
});
delete props.value;
return React.createElement(
'input',
props
);
}
更新
看来这将是固定在阵营16:https://github.com/facebook/react/issues/554#issuecomment-271579096
如果您看看上面的历史,你会的这个问题已经被#5746封闭了。 如果你打开这个PR,你会看到它的里程碑设置为16.
所以修复将在16,我们不能把它放在15.x,因为它引入了行为的突变。
我不知道是否有可能将其恢复到15.x. @jquense和@nhunzaker可能会回答这个问题。
来源
2016-08-19 20:59:44
Ben