Skip to content

connect not running on on exported component class #163

Closed
@rockingskier

Description

@rockingskier

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:

  "dependencies": {
    "history": "^1.12.5",
    "react": "^0.14.0",
    "react-dom": "^0.14.0",
    "react-redux": "^4.0.0",
    "react-router": "^1.0.0-rc3",
    "redux": "^3.0.2",
    "redux-router": "^1.0.0-beta3"
  },

Fairly standard stuff.

There are two files worth looking at:

index.jsx - Basically a whole application
App.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.

Warning: Failed propType: Required prop `routerState` was not specified in `App`. Check the render method of `RoutingContext`.

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions