mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
7b062b39eb0600cb4514748d474125535ed01123
## 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. DiffTrain build for commit https://github.com/facebook/react/commit/f118b7cebf9c15d11c5973bfd40860b5f457df08.
react-fbsource-import
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%