File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
packages/react-client/src/__tests__ Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,25 @@ describe('ReactFlight', () => {
213
213
expect ( ReactNoop ) . toMatchRenderedOutput ( null ) ;
214
214
} ) ;
215
215
216
+ it ( 'can transport undefined object values' , async ( ) => {
217
+ function ComponentClient ( props ) {
218
+ return 'prop' in props
219
+ ? `\`prop\` in props as '${ props . prop } '`
220
+ : '`prop` not in props' ;
221
+ }
222
+ const Component = clientReference ( ComponentClient ) ;
223
+
224
+ const model = < Component prop = { undefined } /> ;
225
+
226
+ const transport = ReactNoopFlightServer . render ( model ) ;
227
+
228
+ await act ( async ( ) => {
229
+ ReactNoop . render ( await ReactNoopFlightClient . read ( transport ) ) ;
230
+ } ) ;
231
+
232
+ expect ( ReactNoop ) . toMatchRenderedOutput ( "`prop` in props as 'undefined'" ) ;
233
+ } ) ;
234
+
216
235
it ( 'can render an empty fragment' , async ( ) => {
217
236
function Empty ( ) {
218
237
return < React . Fragment /> ;
You can’t perform that action at this time.
0 commit comments