react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

[Bug]: `importMap` option on `renderTo{Pipeable|Readable}Stream` is undocumented

Open hamlim opened this issue 1 year ago • 3 comments
trafficstars

Summary

importMap option is not documented on either page for renderToPipeableStream nor renderToReadableStream

Page

https://react.dev/reference/react-dom/server/renderToReadableStream

Details

After spending a decent amount of time trying to figure out how to inject an importMap when server rendering within React, I finally stumbled across the fixtures which showcase using the importMap option. I have found no reference to this option on the current docs.

hamlim avatar Aug 20 '24 18:08 hamlim

import React from 'react'; import { renderToPipeableStream } from 'react-dom/server';

const App = () => (

Hello, world!
);

const stream = renderToPipeableStream(<App />, { // Your options here importMap: {/* your import map configuration */} });

// Handle the stream as needed

devtunis avatar Aug 20 '24 18:08 devtunis

@TUNISIA-user - yea thats the API, however I haven't found it documented anywhere

hamlim avatar Aug 20 '24 19:08 hamlim

devtunis avatar Aug 22 '24 15:08 devtunis