Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use strict null checks
  • Loading branch information
chirokas committed Sep 1, 2026
commit 2ff47b70a143d6cd7733e50b46291ba1cf873663
14 changes: 7 additions & 7 deletions packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -2991,7 +2991,7 @@ type StoredEventListener = {
// When once:true, a wrapper that removes the fragment listener after the
// first fire. Otherwise the same as listener.
attachedListener: EventListener,
cleanup: void | (() => void),
cleanup: null | (() => void),
};

export type FragmentInstanceType = {
Expand Down Expand Up @@ -3035,11 +3035,11 @@ FragmentInstance.prototype.addEventListener = function (
listener: EventListener,
optionsOrUseCapture?: EventListenerOptionsOrUseCapture,
): void {
let signal: void | AbortSignal;
let cleanup: void | (() => void);
let signal: null | AbortSignal = null;
let cleanup: null | (() => void) = null;
if (optionsOrUseCapture != null && typeof optionsOrUseCapture !== 'boolean') {
signal = optionsOrUseCapture.signal;
if (signal != null && signal.aborted) {
signal = optionsOrUseCapture.signal || null;
if (signal !== null && signal.aborted) {
return;
}
}
Expand Down Expand Up @@ -3073,7 +3073,7 @@ FragmentInstance.prototype.addEventListener = function (
}
};
}
if (signal != null) {
if (signal !== null) {
const onAbort = fragmentInstance.removeEventListener.bind(
fragmentInstance,
type,
Expand Down Expand Up @@ -3146,7 +3146,7 @@ FragmentInstance.prototype.removeEventListener = function (
attachOptions,
);
listeners.splice(index, 1);
if (cleanup != null) {
if (cleanup !== null) {
cleanup();
}
};
Expand Down
Loading