React-select: Uncaught TypeError: (0 , _classnames2.default) is not a function

Created on 8 Nov 2015  路  17Comments  路  Source: JedWatson/react-select

Most helpful comment

I encountered the same issue. Later I figured out that I did not wrap the _bindActionCreators_ method in curly braces!

import { bindActionCreators } from "redux";

All 17 comments

Is there a fix for this? I have the same error with the multiselect example.
Uncaught TypeError: (0 , h.default) is not a function (minified version).

Anyone ? :/ _bashes head against wall_

Having the same problem

Uncaught TypeError: (0 , _classnames2.default) is not a function

I'm using b2afb88 and I have no idea for a workaround.

Any luck anyone?

For anyone else who stumbles upon this. The problem was with using files from dist/ without also including the dependencies (classnames and input-autosize)

It's because Babel 6 changed behavior of exports.

redux-logger has same problem, it fixed by babel-plugin-add-module-exports.

@tomprats workaround worked for me! thanks!

I encountered the same issue. Later I figured out that I did not wrap the _bindActionCreators_ method in curly braces!

import { bindActionCreators } from "redux";

In my case, it was forgetting to wrap _connect_ in curlys:

import { connect } from 'react-redux'

I still don't know how to fix the problem, can help ?

@Unique111 Have you looked through your code to make sure you have the correct variables wrapped in curly's? That was the culprit for me and some others on this thread.

I think the culprit for me is not the curlys锛宐ecause I didn't use react-redux @qodesmith
It should be "For anyone else who stumbles upon this. The problem was with using files from dist/ without also including the dependencies (classnames and input-autosize)"锛宻o how to do with this锛烮 am new for this~ @tomprats

@Unique111 I had to put the following into my application.js file to get rid of the problem:

//= require react
//= require react_ujs
//= require classnames
//= require react-input-autosize
//= require react-select

@Unique111 I like your question mark. U+FF1F

Closing this as it can be resolved by following https://github.com/JedWatson/react-select/issues/582#issuecomment-163072471 recommendation. Note this can widely depend on your setup and how you load in dependencies.

Found this from Google.

In my case it was because I was importing A.js from B.js, and B.js from A.js.

putting curly braces arround variable worked for me
import { capitalizeFirstLetter } from '../../utils/common/functions'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ericj17 picture ericj17  路  3Comments

pashap picture pashap  路  3Comments

juliensnz picture juliensnz  路  3Comments

pablote picture pablote  路  3Comments

Meesam picture Meesam  路  3Comments