Hello :smiley: I followed <https://github.com/JetB...
# react
c
Hello 😃 I followed https://github.com/JetBrains/kotlin-wrappers/blob/a5689a7b8d43fc5f3dce0a31bc37b59f382d6e70/examples/src/jsMain/kotlin/example/ForwardingRefs.kt But whenever I call .current?.focus() on the reference from a useEffect() inside my FC, .current is still null, so it doesn't change the focus. I don't know if it is related, but I use the import
org.w3c.dom.HTMLInputElement
instead of
web.html.HTMLElement
and
web.html.HTMLInputElement
. Thanks in advance!
✅ 1
t
cc @Sergei Grishchenko
s
I checked this example, it works for me, make sure that you use
ForwardRef
that has only one props parameter in callback, if it has 2 params (
props
&
forwardedRef
) it means you use previous version of wrappers, in that case use second param
forwardedRef
instead of
props.ref
in your
FancyInput
. We changed this API because we wanted to get rid of two params in
ForwardRef
callback.
c
Thank you very much. I updated to the latest version of kotlin wrappers, used the ForwardRef with only props as callback param, now it works.