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

connectToStores not works as expected? #8

Open
Bogdaan opened this issue Dec 15, 2015 · 1 comment
Open

connectToStores not works as expected? #8

Bogdaan opened this issue Dec 15, 2015 · 1 comment

Comments

@Bogdaan
Copy link

Bogdaan commented Dec 15, 2015

For example:

npm install --save alt alt-utils

import connectToStores from 'alt-utils/lib/connectToStores';
import TodoStore from '../../stores/TodoStore'

class Todo extends Component {
    static getStores() {
      return [TodoStore];
    }

    static getPropsFromStores() {
      return TodoStore.getState();
    }    
}
export default connectToStores(Todo)

Result:

Error: connectToStores() expects the wrapped component to have a static getStores() method
    at /node_modules/alt-utils/lib/connectToStores.js:65:13
    at connectToStores (/node_modules/alt-utils/lib/connectToStores.js:113:5)
    at Object.<anonymous> (/build/webpack:/src/components/Todo/index.jsx:1213:16)
    at __webpack_require__ (/build/webpack:/webpack/bootstrap 1e13b48f6ed5c94ceb23:19:1)
    at Object.module.exports.Object.defineProperty.value (/build/webpack:/src/routes.js:24:63)
    at __webpack_require__ (/build/webpack:/webpack/bootstrap 1e13b48f6ed5c94ceb23:19:1)
    at Object.<anonymous> (/build/webpack:/src/server.js:7:40)
    at __webpack_require__ (/build/webpack:/webpack/bootstrap 1e13b48f6ed5c94ceb23:19:1)
    at module.exports._this2 (/build/webpack:/webpack/bootstrap 1e13b48f6ed5c94ceb23:39:1)
    at Object.<anonymous> (/build/webpack:/webpack/bootstrap 1e13b48f6ed5c94ceb23:39:1)
@tonilaukka
Copy link

I'm having exactly same propblem. Did you find a solution to this?

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

2 participants