reactjs / react.dev

The React documentation website
https://react.dev/
Creative Commons Attribution 4.0 International
11.05k stars 7.55k forks source link

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

Open hamlim opened 2 months ago

hamlim commented 2 months ago

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.

TUNISIA-user commented 2 months ago

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

const App = () => (

Hello, world!

);

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

// Handle the stream as needed

hamlim commented 2 months ago

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

TUNISIA-user commented 2 months ago

+