How to convert this to the latest kotlin-react? <h...
# react
r
How to convert this to the latest kotlin-react? https://codesandbox.io/s/cold-pine-eyr62?file=/src/index.js
t
Is it about
ref
?
r
Yes
I found something about
RefCallback
and it does seem to work here: https://github.com/rjaros/kvision/blob/master/kvision-modules/kvision-react/src/test/kotlin/test/io/kvision/react/ReactSpec.kt#L41-L54 But I'm not sure this is correct and I get a warning from react in logs about wrong use of hooks.
t
If you want in place call - use
RefCallback
factory (not hook)
r
Tests are passing, the warning is gone. Thank you đŸ™‚
t
Hook - for memoization
If memoization ist’s required - you can use factory method