EzDevInfo.com

react-select

A Select control built with and for React JS React-Select Example a flexible and beautiful select input control for reactjs with multiselect, autocomplete and ajax support.

The react-select module cannot find react

React-select cannot find React: TypeError: React is undefined1 react-select.js:826:4

React-select.js is getting react through

var React = (window.React);

It lookes like i have to include React in the html to make this work, but i would like to avoid this. Is there something i am missing?

(using node)


Source: (StackOverflow)

Debugging crazy React library line of code

I'm trying to make use of this react plugin thats kind of like Chosen for React. Here's a link to the full repo: https://github.com/JedWatson/react-select. I'm getting errors on a crazy line in there and am having trouble figuring out what the problem is and how to fix it. I'm running React .11.2. Any help would be appreciated!

Here's the line it appears to be failing on:

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: "×" } })

And gives me an error:

Uncaught TypeError: undefined is not a function

Inside of:

// 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);
}

Which is in react-with-addons.js and its the type var that is failing. Its receiving a string "span". Any ideas on how to fix this?


Source: (StackOverflow)

Advertisements