dillon1000/react
Commit
Browse files [Flight] Improve Error Messages when Invalid Object is Passed to Client/Host Components (#25492)
* Print built-in specific error message for toJSON This is a better message for Date. Also, format the message to highlight the affected prop. * Describe error messages using JSX elements in DEV We don't have access to the grand parent objects on the stack so we stash them on weakmaps so we can access them while printing error messages. Might be a bit slow. * Capitalize Server/Client Component * Special case errror messages for children of host components These are likely meant to be text content if they're not a supported object. * Update error messages
Changed paths6 files
First-parent comparisonpackages/react-client/src/__tests__/ReactFlight-test.js ModifiedM packages/react-server-dom-relay/src/__tests__/ReactFlightDOMRelay-test.internal.js ModifiedM packages/react-server-native-relay/src/__tests__/ReactFlightNativeRelay-test.internal.js ModifiedM packages/react-server-native-relay/src/__tests__/__snapshots__/ReactFlightNativeRelay-test.internal.js.snap ModifiedM packages/react-server/src/ReactFlightServer.js ModifiedM scripts/error-codes/codes.json ModifiedPatch
Files changed
Rendering syntax-highlighted changes…