@@ -251,14 +251,14 @@ function functionBodyPushAttributes(
251
251
function processJSX (
252
252
context : JSXProcessingContext ,
253
253
jsxNode : Babel . NodePath ,
254
- componentName ?: string | null
254
+ componentName ?: string
255
255
) : void {
256
256
if ( ! jsxNode ) {
257
257
return ;
258
258
}
259
259
260
260
// Use provided componentName or fall back to context componentName
261
- const currentComponentName = componentName !== undefined ? componentName : context . componentName ;
261
+ const currentComponentName = componentName ?? context . componentName ;
262
262
263
263
// NOTE: I don't know of a case where `openingElement` would have more than one item,
264
264
// but it's safer to always iterate
@@ -300,7 +300,7 @@ function processJSX(
300
300
shouldSetComponentName = false ;
301
301
processJSX ( context , child , currentComponentName ) ;
302
302
} else {
303
- processJSX ( context , child , null ) ;
303
+ processJSX ( context , child , "" ) ;
304
304
}
305
305
} ) ;
306
306
}
@@ -313,7 +313,7 @@ function processJSX(
313
313
function applyAttributes (
314
314
context : JSXProcessingContext ,
315
315
openingElement : Babel . NodePath < Babel . types . JSXOpeningElement > ,
316
- componentName : string | null
316
+ componentName : string
317
317
) : void {
318
318
const { t, attributeNames, ignoredComponents, fragmentContext, sourceFileName } = context ;
319
319
const [ componentAttributeName , elementAttributeName , sourceFileAttributeName ] = attributeNames ;
0 commit comments