2018-09-16 21:33:42 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { renderToString } from 'react-dom/server'
|
2019-04-16 21:21:01 +02:00
|
|
|
import AppProvider from './src/store/Provider'
|
2018-09-14 18:27:49 +02:00
|
|
|
import wrapPageElementWithTransition from './src/helpers/wrapPageElement'
|
|
|
|
|
2018-09-16 21:33:42 +02:00
|
|
|
export const replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => {
|
|
|
|
// React Context in SSR/build
|
|
|
|
const ConnectedBody = () => <AppProvider>{bodyComponent}</AppProvider>
|
|
|
|
replaceBodyHTMLString(renderToString(<ConnectedBody />))
|
|
|
|
}
|
|
|
|
|
2018-09-14 20:22:57 +02:00
|
|
|
// Page Transitions & Layout
|
2018-09-14 18:27:49 +02:00
|
|
|
export const wrapPageElement = wrapPageElementWithTransition
|