brocoders / redux-async-connect

It allows you to request async data, store them in redux state and connect them to your react component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use `connect` and `asyncConnect` on the same component

quicksnap opened this issue · comments

I'm reviewing the simple-router branch on RRUHE: erikras/react-redux-universal-hot-example@4567347

Implementing it in my own project, everything works great! I like how I can define the static method reduxAsyncConnect and dispatch from there.

I was exploring using the decorator, but using that would prevent me from connecting to the rest of redux state.

Reading the code, is store available within

We could resolve this a few ways. One way would be to change the API of @asyncConnect to accept params that pass through to @connect. Example:

@asyncConnect(asyncMapStateToProps, [...normal connect params])

Hi, @quicksnap

actually, i don't see any problems with using both @connect and @asyncConnect decorators
https://github.com/sars/appetini-front/blob/appetini/src/containers/App/App.js#L20

What was the problem?...

I was coming across a rendering problem in my app.. perhaps it was something else.

Have you tested how this affects things when using @connect to bind to a non-redux-async-connect property? I wonder about shouldComponentUpdate of multiple connect calls clashing.

I'll try retesting in a bit. Reviewing connect, it shouldn't cause any issues. Must have been on my end.

@quicksnap , yeah... it should work fine ..