brocoders / redux-async-connect

It allows you to request async data, store them in redux state and connect them to your react component.
645 stars 103 forks source link

A least one Component in Route must be asyncConnected, otherwise server rendering returns noscript #69

Open djeeg opened 8 years ago

djeeg commented 8 years ago

Say I have routes setup like this:

RootLayoutComponent
--/
----HomeViewComponent
------AHomeComponent
--/subpage
----SubpageViewComponent
------asyncConnect(ASubpageComponent)

/subpage server renders correctly however / only returns

the workaround seems to be, force at least one component on the page to be asyncConnected

achievable by something like this on the root component:

const AsyncRootLayout = asyncConnect([{
    deferred: false,
    promise: ({store}) => {
        return Promise.resolve(0)
    }
}])(RootLayout)

export default AsyncRootLayout;

is this the expected behaviour?

pandaiolo commented 8 years ago

Maybe linked to #60