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

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

djeeg opened this issue · comments

commented

Say I have routes setup like this:

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

/subpage server renders correctly
however / only returns tags (ie no server rendering)

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?

Maybe linked to #60