Created
July 28, 2018 20:56
-
-
Save city41/99f86ac5654f44432abeb144e122f814 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { renderToString } from 'react-dom/server'; | |
import { MockedProvider } from 'react-apollo/test-utils'; | |
export const replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => { | |
const ConnectedBody = () => ( | |
<MockedProvider> | |
{bodyComponent} | |
</MockedProvider> | |
); | |
const result = renderToString(<ConnectedBody />); | |
replaceBodyHTMLString(result); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment