From 05d389d71eea8733ed5929baeb99df5721840f19 Mon Sep 17 00:00:00 2001 From: John Feng <86398653+atjohnfeng@users.noreply.github.com> Date: Mon, 20 Mar 2023 14:47:57 -0700 Subject: [PATCH] Ignore usage of useInsertionEffect (hook introduced in React 18) in dispatcher --- src/internals/dispatcher.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internals/dispatcher.js b/src/internals/dispatcher.js index d551112..1d955f3 100644 --- a/src/internals/dispatcher.js +++ b/src/internals/dispatcher.js @@ -351,9 +351,10 @@ export const Dispatcher = { useId: useOpaqueIdentifier, unstable_useId: useOpaqueIdentifier, unstable_useOpaqueIdentifier: useOpaqueIdentifier, - // ignore useLayout effect completely as usage of it will be caught + // ignore useLayout / useInsertion effect completely as usage of it will be caught // in a subsequent render pass useLayoutEffect: noop, + useInsertionEffect: noop, // useImperativeHandle is not run in the server environment useImperativeHandle: noop, // Effects are not run in the server environment.