Skip to content

Commit 656a45d

Browse files
committed
use optional chain
1 parent 31ba069 commit 656a45d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/components/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@ function createSlotRegistry(): SlotFillBubblesVirtuallyContext {
2828
ref,
2929
fillProps
3030
) => {
31-
const slot = slots.get( name ) || {
32-
ref: undefined,
33-
fillProps: undefined,
34-
};
31+
const slot = slots.get( name );
3532

3633
slots.set(
3734
name,
3835
valRef( {
3936
...slot,
40-
ref: ref || slot.ref,
41-
fillProps: fillProps || slot.fillProps || {},
37+
ref: ref || slot?.ref,
38+
fillProps: fillProps || slot?.fillProps || {},
4239
} )
4340
);
4441
};

0 commit comments

Comments
 (0)