Files
react/packages/react-server
Andrew Clark 00ced1e2b7 Fix useId in strict mode (#22681)
* Fix: useId in strict mode

In strict mode, `renderWithHooks` is called twice to flush out
side effects.

Modying the tree context (`pushTreeId` and `pushTreeFork`) is effectful,
so before this fix, the tree context was allocating two slots for a
materialized id instead of one.

To address, I lifted those calls outside of `renderWithHooks`. This
is how I had originally structured it, and it's how Fizz is structured,
too. The other solution would be to reset the stack in between the calls
but that's also a bit weird because we usually only ever reset the
stack during unwind or complete.

* Add test for render phase updates

Noticed this while fixing the previous bug
2021-11-02 17:59:17 -07:00
..
2020-10-30 23:03:45 -07:00
2021-11-02 17:59:17 -07:00
2020-03-07 11:23:30 -08:00
2020-10-30 23:03:45 -07:00

react-server

This is an experimental package for creating custom React streaming server renderers.

Its API is not as stable as that of React, React Native, or React DOM, and does not follow the common versioning scheme.

Use it at your own risk.