We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to switch from redux-async-connect to redux-connect. I migrated as done in this PR erikras/react-redux-universal-hot-example#1140
redux-async-connect
redux-connect
The problem is that once I replace all from 'redux-async-connect in import statements with redux-connect it doesn't fetch any data anymore.
from 'redux-async-connect
import
This is part of an example page where I want to use redux-connect:
import React, {Component, PropTypes} from 'react'; import Helmet from 'react-helmet'; import { asyncConnect } from 'redux-async-connect'; import {connect} from 'react-redux'; @asyncConnect([{ deferred: true, promise: ({ store: { dispatch, getState, } }) => { if (!isLoaded(getState())) { return dispatch(load()); } } }]) @connect( state => ({ items: state.invoice.data, error: state.invoice.error, loading: state.invoice.loading, loaded: state.invoice.loaded, messages: state.intl.messages, }), dispatch => ({dispatch}) )
The text was updated successfully, but these errors were encountered:
I am having a similar issue on the latest version, I reverted back to version 2.1.0 and it seems to work.
Sorry, something went wrong.
import React, { Component, PropTypes } from 'react'; import Helmet from 'react-helmet'; import { asyncConnect } from 'redux-connect'; @asyncConnect([{ promise: ({ store: { dispatch, getState } }) => { if (!isLoaded(getState())) { // must return promise! return dispatch(load()); } } }], state => ({ items: state.invoice.data, error: state.invoice.error, loading: state.invoice.loading, loaded: state.invoice.loaded, messages: state.intl.messages, }))
This is optimized version of your code, since dispatch is passed by connect in any case
No branches or pull requests
I'm trying to switch from
redux-async-connect
toredux-connect
.I migrated as done in this PR erikras/react-redux-universal-hot-example#1140
The problem is that once I replace all
from 'redux-async-connect
inimport
statements withredux-connect
it doesn't fetch any data anymore.This is part of an example page where I want to use
redux-connect
:The text was updated successfully, but these errors were encountered: