Skip to content

Commit cbb18aa

Browse files
authored
Fix compatibility with cloudflare workers (#492)
cloudflare workers throw error if you initialize AbortController in global scope see: cloudflare/workerd#3657, #483
1 parent 2750fb4 commit cbb18aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-resizable-panels/src/PanelResizeHandleRegistry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@ function updateCursor() {
300300
}
301301
}
302302

303-
let listenersAbortController = new AbortController();
303+
let listenersAbortController: AbortController | undefined;
304304

305305
function updateListeners() {
306-
listenersAbortController.abort();
306+
listenersAbortController?.abort();
307307
listenersAbortController = new AbortController();
308308

309309
const options: AddEventListenerOptions = {

0 commit comments

Comments
 (0)