Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the Async SSR (renderToStream) part of the readme up to date? #46

Closed
mathieux51 opened this issue Nov 21, 2018 · 3 comments
Closed

Comments

@mathieux51
Copy link

Hi,

I'm a bit confused by this part of the readme/doc. Could this snippet:

import {ImportedStream, drainHydrateMarks} from 'react-imported-component';

let streamUID = 0;
const html = renderToString(
  <ImportedStream takeUID={uid => streamUID=uid}>
    <YourApp />
  </ImportedStream>) + printDrainHydrateMarks(streamUID);

be

import {ImportedStream, printDrainHydrateMarks} from 'react-imported-component';
import { renderToNodeStream } from 'react-dom/server';

let streamUID = 0;
const html = renderToNodeStream(
  <ImportedStream takeUID={uid => streamUID=uid}>
    <YourApp />
  </ImportedStream>) + printDrainHydrateMarks(streamUID);

? Or maybe I'm just missing something.
Thanks for you help.

@theKashey
Copy link
Owner

My bad.
But yes - you are absolutely right - it would just work as you written.

@mathieux51
Copy link
Author

All good. Thanks for your quick answer 👍.

@theKashey
Copy link
Owner

Readme updated. Thank you for the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants