From ecc2f945d1444e19321da62ff026c2100e202b37 Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Wed, 24 Apr 2024 08:56:49 +0200 Subject: [PATCH 1/2] fix: enable next.js 14 support --- src/react/core/create-component.ts | 35 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/react/core/create-component.ts b/src/react/core/create-component.ts index 1e944108e9..b42e955951 100644 --- a/src/react/core/create-component.ts +++ b/src/react/core/create-component.ts @@ -181,8 +181,10 @@ const setProperty = ( ) => { const event = events?.[name]; // Dirty check event value. - if (event !== undefined && value !== old) { - addOrUpdateEventListener(node, event, value as (e?: Event) => void); + if (event !== undefined) { + if (value !== old) { + addOrUpdateEventListener(node, event, value as (e?: Event) => void); + } return; } // But don't dirty check properties; elements are assumed to do this. @@ -253,7 +255,7 @@ export const createComponent = ; const ReactComponent = React.forwardRef((props, ref) => { - const prevPropsRef = React.useRef(null); + const prevElemPropsRef = React.useRef(new Map()); const elementRef = React.useRef(null); // Props to be passed to React.createElement @@ -308,20 +310,26 @@ export const createComponent = Date: Wed, 24 Apr 2024 09:11:52 +0200 Subject: [PATCH 2/2] fix: remove unused type --- src/react/core/create-component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/react/core/create-component.ts b/src/react/core/create-component.ts index b42e955951..4a88a0a5b7 100644 --- a/src/react/core/create-component.ts +++ b/src/react/core/create-component.ts @@ -120,7 +120,6 @@ export interface Options { elementClass: Constructor; events?: E; displayName?: string; - renderAttributesOnCreate?: boolean; } type Constructor = { new (): T };