Open jasan-s opened 7 years ago
I tried the following to delay React-snapshot so that it renders html after the store has been rehydrated:
import {render as snapshotRender} from 'react-snapshot'
import {ConnectedRouter} from 'react-router-redux'
async function init() {
const store = await configureStore()
snapshotRender(
<Provider store={store}>
{/* ConnectedRouter will use the store from Provider automatically */}
<ConnectedRouter history={history}>
<App />
</ConnectedRouter>
</Provider>,
document.getElementById('root')
)
registerServiceWorker()
}
init()
But now get the error that 'render' from react-snapshot was never called. Did you replace the call to ReactDOM.render()?
I posted it on stackoverflow as well.
Essentially I need to delay the Snapshot render until my store is hydrated? @geelen Any Suggestions?
I am delaying my main app component render until my store is re-hydrated using redux-persist like so:
However , even with
snapshotDelay
of8200
all the static generated html files fromreact-snapshot
contain only...Loading
. Am I misunderstanding whatsnapshotDelay
option does?Can i use the Async Branch somehow?