dillon1000/react

Commit

[Flight] Gated test for dropped transport of undefined object values (#26478)

## Summary

With https://github.com/facebook/react/pull/26349 we now serialize
`undefined`. However, deserializing it on the client is currently
indistinguishable from the value missing entirely due to how
`JSON.parse` treats `undefined` return value of reviver functions.

This leads to inconsistent behavior of the `Object.hasOwn` or `in`
operator (used for narrowing in TypeScript). In TypeScript-speak, `{
prop: T | undefined}` will arrive as `{ prop?: T }`.

## How did you test this change?

- Added test that is expected to fail. Though ideally the implementation
of the component would not care whether it's used on the client or
server.
Browse files
Changed paths1 file
First-parent comparison
M packages/react-client/src/__tests__/ReactFlight-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…