-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
connect
not running on on exported component class
#163
Comments
Thanks for reporting. Seems like the same issue as gaearon/babel-plugin-react-transform#37 so I'll close it. You can work around it by renaming the import until it's fixed. I'll come back to this issue after fixing the underlying one to confirm that it worked. |
Glad to see someone has caught the issue and its not just me going mad. MY aim is to not actually have the inline |
You want to have two components named "App", one imported from App and another declared in index? The Babel plugin has a bug where it is confused by named import with the same name as something declared in the file. If you remove App from index it will work fine. But of course you can also disable Babel plugin until it is fixed. :-) |
Just the one Defining the class inline with Moving the class to a separate file, still with But yes, removing Thanks! Great work as always! |
I have this issue but I dont have |
Language features don't just "stop working" out of the blue. :-) It's not something we can or should fix in the library. Most likely you're using decorator incorrectly but it's hard to say without code. Please create a StackOverflow question with code example and we will be happy to help. And try not using decorator syntax, instead following examples in the docs. It is unrelated to this issue. |
Indeed, the problem was actually because (after moving to babel 6) I was loading For other reasons, it looks like decorators are broken anyway: babel/babel#2702 But as you mentioned this is unrelated. Cheers! |
Got it, thanks for the explanation! |
OK, so this is actually much more fun than I thought it was. @rockingskier Not sure whether you’re still curious but here’s what happened.
I’ll look if I can fix it on The quick fix is to avoid using |
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
I confirmed https://github.com/rockingskier/redux-problem as fixed by updating to |
@thejameskyle would so love this. |
tries not to gloat ... IN YO FACE ABRAMOV!!! (jk I luv u buddy) |
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
This prevents issues like reduxjs/react-redux#163 (comment)
To be honest I'm not sure if this is the right repo but I'm at an impasse and this is the most obvious place for now.
I have a simple test repo. It is heavily based off the redux-router basic example but simplified for this example.
Among other webpack-esque things the following react/redux libs are installed:
Fairly standard stuff.
There are two files worth looking at:
index.jsx
- Basically a whole applicationApp.jsx
- The main component exported to a separate file.When run in one file,
index.jx
the application work as expected. The component receives props from the@connect
-ed store, all good and happy. Routes run, props are passed, everyone gets what they want.In the name of splitting things out for a real project I started by moving the main App component to a separate file. When I do this however the
@connect
-ing doesn't appear to work.This is first made clear by the Props warning that appears.
This points to
redux-router
however after adding some logging I can see that the@connect
mapStateToProps function is not being called when exporting the component.This all seems very odd to me but tbh it could point to any number of places. The eco system is moving very quickly and its hard to keep up.
Is there an issue with
react-redux
,@connect
,webpack
,babel
,redux-router
or any of the (incredible) hot reloading features?The text was updated successfully, but these errors were encountered: