Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redux.creatStore is not a function #296

Closed
applemate opened this issue Nov 21, 2016 · 18 comments
Closed

redux.creatStore is not a function #296

applemate opened this issue Nov 21, 2016 · 18 comments

Comments

@applemate
Copy link

Hi,

I just install the latest version. Then copied the code from basic sample and make a component (compoent Auto) with that code. Then I import Auto into my project. Run, then I got this error

AutosuggestContainer.js:100Uncaught TypeError: (0 , _redux.createStore) is not a function(…)

Here is the code for Auto of component https://jsfiddle.net/craigcosmo/ju43d66a/

@moroshko
Copy link
Owner

I can't see in the external resources that you import react-autosuggest.

Here is a Basic Codepen example that you can start to play with.

Does this help?

@thebigredgeek
Copy link

@moroshko why use redux internally? Wouldn't it be better to allow the app itself to handle state rather than implicitly forcing a new redux store? Seems kinda hacky :(

@thebigredgeek
Copy link

I am also having this issue :(

@thebigredgeek
Copy link

#260

@superliuwr
Copy link

I am having the same issue. Is there anyone figuring out how to get rid of this?

@moroshko
Copy link
Owner

moroshko commented Dec 7, 2016

@superliuwr Could you help creating a minimal Codepen that reproduces the issue?

@superliuwr
Copy link

@moroshko I tried putting just the component itself into a Codepen and it didn't reproduce the issue. It appears something to do with either Redux or my webpack config. There is a file named redux.js in your source code which I suspect causing name resolving issue of Redux. I however can not prove it at the moment.

@ztratar
Copy link

ztratar commented Dec 9, 2016

It seems the error occurs when a redux store has already been instantiated, but then this library attempts to create another one. Babel/webpack parsing error perhaps?

@applemate
Copy link
Author

@moroshko this is a simple demo that reproduces the bug

https://github.com/craigcosmo/demo

@aarondack
Copy link

I know I'm late to the party, but can anyone actually provide a solid example of the failings of this? I have autosuggest working flawlessly in a massive react-redux app. The above demo appears broken.

@applemate
Copy link
Author

applemate commented Dec 28, 2016

Hi,

Example here https://github.com/craigcosmo/demo

You are right, I forgot to save-dev some dependencies when npm. It's fixed now

@applemate
Copy link
Author

applemate commented Dec 28, 2016

@adack123 I updated the demo, fix the broken dependencies
@moroshko Please have a look

@aarondack
Copy link

Hey @craigcosmo

Sorry to be the bearer of bad news but I just tried out the demo and I'm still getting a lot of webpack related thrown errors revolving around sass and image files.

@applemate
Copy link
Author

applemate commented Dec 29, 2016

@adack123 I know why, the image folder was empty, therefore it was not pushed to git. But the build require the image folder so it complains. I made the fix. please have a look again

@applemate
Copy link
Author

@adack123 have you tested out the reproduction repo I posted?

@moroshko
Copy link
Owner

moroshko commented Jan 8, 2017

redux and react-redux dependencies were removed in v8.0.0.

Could you please upgrade and verify that the issue is gone?

@applemate
Copy link
Author

updated to v8, I got this error

screen shot 2017-01-11 at 10 50 53 am

reproducing https://github.com/craigcosmo/demo

@moroshko
Copy link
Owner

@craigcosmo You have to add:

this.onChange = this.onChange.bind(this);

in your constructor, or alternatively, write onChange like this:

onChange = (event, { newValue, method }) => {
  this.setState({
    value: newValue
  })
};

(do the same for onSuggestionsFetchRequested and onSuggestionsClearRequested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants