From fa87e3d914e31535d4ac80e4c5d22675ac1be5a5 Mon Sep 17 00:00:00 2001 From: Victor Turansky Date: Fri, 6 Dec 2024 15:43:48 +0200 Subject: [PATCH] React 19. Fix `act` package --- .../src/jsMain/kotlin/react/{dom/test => }/act.kt | 4 ++-- .../src/jsMain/kotlin/react/dom/test/createRoot.kt | 1 + .../src/jsMain/kotlin/react/dom/test/unmount.kt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) rename kotlin-react-dom-test-utils/src/jsMain/kotlin/react/{dom/test => }/act.kt (77%) diff --git a/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/act.kt b/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/act.kt similarity index 77% rename from kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/act.kt rename to kotlin-react-dom-test-utils/src/jsMain/kotlin/react/act.kt index 06cad80874a4d..289813354561b 100644 --- a/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/act.kt +++ b/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/act.kt @@ -1,6 +1,6 @@ -@file:JsModule("react-dom/test-utils") +@file:JsModule("react") -package react.dom.test +package react import js.promise.Promise import seskar.js.JsAsync diff --git a/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/createRoot.kt b/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/createRoot.kt index 3531d3a276092..f685496e168ce 100644 --- a/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/createRoot.kt +++ b/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/createRoot.kt @@ -2,6 +2,7 @@ package react.dom.test import react.FC import react.Props +import react.act import react.create import react.dom.client.Root import react.dom.client.createRoot diff --git a/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/unmount.kt b/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/unmount.kt index 9e28993ed38f3..5ddbbb98a9142 100644 --- a/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/unmount.kt +++ b/kotlin-react-dom-test-utils/src/jsMain/kotlin/react/dom/test/unmount.kt @@ -1,5 +1,6 @@ package react.dom.test +import react.act import react.dom.client.Root suspend fun unmount(