From 3d8b6edd8709267ea27dc5bb510ffefad94ec762 Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Thu, 2 Jan 2025 15:40:15 +0200 Subject: [PATCH] React. Separate file for `createElement` --- .../src/jsMain/kotlin/react/ReactElement.kt | 6 ------ .../src/jsMain/kotlin/react/createElement.kt | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 kotlin-react-core/src/jsMain/kotlin/react/createElement.kt diff --git a/kotlin-react-core/src/jsMain/kotlin/react/ReactElement.kt b/kotlin-react-core/src/jsMain/kotlin/react/ReactElement.kt index 65520467259a6..187dda6597fa3 100644 --- a/kotlin-react-core/src/jsMain/kotlin/react/ReactElement.kt +++ b/kotlin-react-core/src/jsMain/kotlin/react/ReactElement.kt @@ -7,9 +7,3 @@ sealed external interface ReactElement

: ReactNode { val props: P val key: Key? } - -external fun

createElement( - type: ElementType

, - props: P? = definedExternally, - vararg children: ReactNode?, -): ReactElement

diff --git a/kotlin-react-core/src/jsMain/kotlin/react/createElement.kt b/kotlin-react-core/src/jsMain/kotlin/react/createElement.kt new file mode 100644 index 0000000000000..6831f491188ad --- /dev/null +++ b/kotlin-react-core/src/jsMain/kotlin/react/createElement.kt @@ -0,0 +1,9 @@ +@file:JsModule("react") + +package react + +external fun

createElement( + type: ElementType

, + props: P? = definedExternally, + vararg children: ReactNode?, +): ReactElement