I'm getting back to kotlin react wrappers after qu...
# react
j
I'm getting back to kotlin react wrappers after quite some time. Trying to update dependencies, I want to migrate to the new DSL and APIs (
RBuilder
->
ChildrenBuilder
), but I find no migration guide. Where can I find information apart from the very succinct summary from the
CHANGELOG.md
? For instance, how should I define the react entrypoint now? I used to use:
Copy code
val store = initRedux()

render(rootElement) {
    provider(store) {
        application()
    }
}
With
application
being an extension function on
RBuilder
. However I get a deprecation warning on
render()
, but with no
ReplaceWith
nor explanation about what I should use instead. Any hints?
t
Render example
createRoot
- React 18 API
j
Thanks, so I have to create function components now I guess. How does that play out with `kotlin-react-redux`'s
provider()
function, by the way? It seems that it's defined with
RBuilder
receiver. Do we have a new redux API as well?
t
Copy code
val reduxStore = initStore()

val app = Provider.create {
    store = reduxStore
    
    Application()
}

createRoot(container)
    .render(app)
j
Thanks, I will try this. I didn't know the
Provider
component was available like this directly
t
provider
- just sugar, which hide real logic (like in your example)