https://kotlinlang.org logo
#react
Title
# react
m

Mihai Voicescu

06/28/2022, 3:30 PM
After upgrading from react 17 (17.0.2-pre.282-kotlin-1.6.10) to 18 (18.2.0-pre.348) it looks like it does not recognize the react import. Did the API change?
Copy code
Unresolved reference: react
and the line is
Copy code
import react.useState
I am using the IR compiler... with
kotlin_version=1.6.20
1
Even running the default JS setup with react 18 fails
I opened an issue since it seems like a bug https://github.com/JetBrains/kotlin-wrappers/issues/1553
t

turansky

06/28/2022, 4:02 PM
Kotlin
1.7.0
required since pre.344
m

Mihai Voicescu

06/28/2022, 4:18 PM
Also tried with
Copy code
kotlin("js") version "1.7.0"
same result
t

turansky

06/28/2022, 4:21 PM
And
./gradlew clean
before?
🙌 1
m

Mihai Voicescu

06/29/2022, 7:47 AM
Yep, cleaning did the Job. Thank you @turansky! BTW, does anybody know what the difference is between the
-compat
and normal ones?
f

Florent Martin

08/02/2023, 5:20 AM
I seem to have the same problem,
.gradlew clean
does not help, my version is
Copy code
kotlin("multiplatform") version "1.8.22"
7 Views