I divided the project into subprojects, I am tryin...
# javascript
a
I divided the project into subprojects, I am trying to implement lazy loading, I described the import function like this:
Copy code
external fun <T> import(path: String): Promise<T>
or
Copy code
external fun <dynamic> import(path: String): Promise<dynamic>
I try to use like this:
Copy code
val SomePage = rLazy<dynamic> {
    { import<dynamic>("./somePage.js") }
}
I get the error: Type mismatch. Required: RClass<TypeVariable(P)> Found: () → Promise<dynamic> Why? I don't understand by the signature, I give him a lambda and he sees a promise inside the lambda.
t
Looks like you need use
react.lazy
inside.