brocoders/redux-async-connect

How to access props in reduxAsyncConnect function?

greyvugrin opened this issue · 2 comments

Following the example from the docs, but can't seem to get access to props at this stage.

static reduxAsyncConnect(params, store, helpers) {
    const {dispatch, getState} = store
    console.log(this)
    const { videoId } = this.props
    if (!isLoaded(getState())) {
      return dispatch(getVideo(videoId))
    }
  }

Unless I'm missing something and you would have to provide a videoID in some other way? Are props just not available at this point?

Tried hard coding the ID for now, now running into ReferenceError: isLoaded is not defined

Disregard this, for anoyone wondering, isLoaded is BYOF (build your own function). Check out https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/containers/Widgets/Widgets.js for an example.