I want to use react-infinite-grid in Kotlin http://ggordan.com/post/react-infinite-grid.html
I have seen the How to import node module in React-Kotlin?
Below code is my reference it:
InfiniteGrid.kt
@file:JsModule("react-infinite-grid")
@file:JsNonModule
package react.infinite.grid
import react.*
external interface InfiniteGridProps: RProps {
var wrapperHeight: Int
var entries: Array<*>
}
@JsName("default")
external val InfiniteGrid : RClass<InfiniteGridProps>
main.kt
package index
import kotlinext.js.*
import react.dom.*
import kotlinx.browser.*
import react.infinite.grid.InfiniteGrid
fun main(){
requireAll(require.context("src", true, js("/\\.css$/")))
render(document.getElementById("root")) {
InfiniteGrid{
attrs.wrapperHeight = 400
attrs.entries = arrayOf(1, 11, 111, 1111)
}
}
}
But, I have error:
Error: Element ref was specified as a string (wrapper) but no owner was set. This could happen for one of the following reasons:
- You may be adding a ref to a function component
- You may be adding a ref to a component that was not created inside a component's render method
- You have multiple copies of React loaded See https://reactjs.org/warnings/refs-must-have-owner.html for more information.
I tried How to import node module in React-Kotlin? two way is not success.
Please Help To Me
Thank You
Update:
I finded is react-infinite-grid
cannot support react
16.0.0 or newer.
With Kotlin Wrap No relation.