我正在尝试使用这个类似于 Chosen for React 的反应插件。这是完整仓库的链接:https ://github.com/JedWatson/react-select ://github.com/JedWatson/react-select 。我在一条疯狂的线路上遇到错误,并且无法弄清楚问题是什么以及如何解决它。我正在运行 React .11.2。任何帮助,将不胜感激!
这是它似乎失败的行:
React.createElement("span", { className: "Select-clear", title: this.props.multi ? this.props.clearAllText : this.props.clearValueText, "aria-label": this.props.multi ? this.props.clearAllText : this.props.clearValueText, onMouseDown: this.clearValue, onClick: this.clearValue, dangerouslySetInnerHTML: { __html: "×" } })
并给我一个错误:
Uncaught TypeError: undefined is not a function
代替:
// Specifying arguments isn't necessary since we just use apply anyway, but it
// makes it clear for those actually consuming this API.
function createDescriptor(type, props, children) {
var args = Array.prototype.slice.call(arguments, 1);
return type.apply(null, args);
}
哪个在其中react-with-addons.js
,它的type
var 失败了。它接收一个字符串"span"
。有想法该怎么解决这个吗?