Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jolanrensen/react-list-kotlin-js-react-wrapper
This simple repo allows you to use react-list (https://www.npmjs.com/package/react-list) from your Kotlin/JS/React project.
https://github.com/jolanrensen/react-list-kotlin-js-react-wrapper
Last synced: 26 days ago
JSON representation
This simple repo allows you to use react-list (https://www.npmjs.com/package/react-list) from your Kotlin/JS/React project.
- Host: GitHub
- URL: https://github.com/jolanrensen/react-list-kotlin-js-react-wrapper
- Owner: Jolanrensen
- License: mit
- Created: 2020-01-04T17:08:53.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-01T14:43:14.000Z (almost 5 years ago)
- Last Synced: 2023-07-25T12:11:16.188Z (over 1 year ago)
- Language: Kotlin
- Size: 8.79 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-list Kotlin/JS/React wrapper
This simple repo allows you to use react-list (https://www.npmjs.com/package/react-list) from your Kotlin/JS/React project.Feel free to turn it into a library, as I'm not sure how (plus, I'm kinda busy).
Example:
```kotlin
var list: ReactListRef? = nullprivate val renderRow: (Int, String) -> ReactElement? = { index: Int, key: String ->
buildElement {
// Build your list item here based on the index given and give it the key
}
}override fun RBuilder.render() {
styledReactList {
css {
width = 320.px
}
attrs {
length = yourItems
itemRenderer = renderRow
type = "variable"
ref {
list = it
}
}
}
}fun scrollToTop() {
list?.scrollTo(0)
}```